Print

Print


Matthew,

 

Thank you so much, that was exactly it!  Although, this is a bit troubling, because what was extra in the file was a space in the line BEFORE the /Matrix line, which means that this /Matrix is being ignored and it is simply accepting all lines with something even if they occur prior to the /Matrix designation line.  What is also odd is that setup_masks and randomise are clearly treating these differently.  Randomise runs fine with the space in that one line, clearly obeying the /Matrix designation and ignoring the line prior to it, while setup_masks fails because it ignores the /matrix designation and then reads in the space line prior to it as an additional subject entry.  It is also troubling that setup_masks does not read in the /NumPoints designation in the file, because it runs fine even though this number did not match the number of subjects (well, at least the number of subjects it thought it had because of the line with a space). 

 

Thank you once again for catching this; I hope the issues I’ve raised above can be corrected in the next version of the setup_masks function call.

 

Best,

 

Mark

 

____________________
Mark Wagshul, PhD
Associate Professor
Gruss Magnetic Resonance Research Center
Albert Einstein College of Medicine
Bronx, NY 10461

Ph: 718-430-4011

FAX: 718-430-3399

Email: [log in to unmask]

 

einstein-logo-rgb

This email message and any accompanying attachments may contain privileged information intended only for the named recipient(s). If you are not the intended recipient(s), you are hereby notified that the dissemination, distribution, and or copying of this message is strictly prohibited. If you receive this message in error, or are not the named recipient(s), please notify the sender at the email address above, delete this email from your computer, and destroy any copies in any form immediately.

 

 

From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On Behalf Of Matthew Webster
Sent: Tuesday, August 15, 2017 8:48 AM
To: [log in to unmask]
Subject: Re: [FSL] handling of zeros in randomise

 

Hello Mark,

                          Is it possible your design.mat has a rogue carriage-return ( or other whitespace character )? Can you run Vest2Text on your ( original ) design.mat and let me know the result of running wc -l on the output of that?

 

Kind Regards

Matthew

--------------------------------

Dr Matthew Webster

FMRIB Centre 

John Radcliffe Hospital

University of Oxford

 

On 15 Aug 2017, at 11:47, Mark Wagshul <[log in to unmask]> wrote:

 

I can't send the data for a few days, but I think I can describe the problem quite simply.

 

In the example I sent, the input data and design matrix have four subjects.  According to the instructions on the website, setup_masks should need 7 inputs in this case: 1) input design matrix, 2) input contrast file, 3) base name for the output, and four mask files (nifti images).  However, I find that it only works with 8 inputs, requiring 5 nifti files instead of the expected 4. 

 

 Is it possible that there is an error in the description of the usage of the function and there is some additional nifti file needed, such as the original nifti data file with the data from my four subjects?  The first step in the process seems to be fslmerge for which in my case it is merging the 5 nifti files I gave it as inputs (i.e. The last five inputs to the function call), which I assume will be used as the regressor, so I would expect it to have the same dimensionality as my data, i.e. 4 in this case, not 5. 

 

But, from the output design matrix file, it seems that my dimensionality has changed to 5, since an additional line has been added (the first line, 1 0 0 0 0).  In which case, it would work with the new file, I'm just not sure what the extra nifti file should be.

 

Hope this helps.  If not, I will send the data files over in a couple of days.  Thanks again for all the help.  Best,

 

Mark

_______________________

Mark Wagshul, PhD

Albert Einstein College of Medicine

Bronx, NY

 

Sent from my iPhone


On Aug 14, 2017, at 12:27 AM, Anderson M. Winkler <[log in to unmask]> wrote:

Hi Mark,

 

I'm unsure I quite get what the problem is but if you believe there is a problem and would like to upload your input files to some file sharing service and send the link off-list, I could have a look.

 

All the best,

 

Anderson

 

 

On 11 August 2017 at 15:11, Mark Wagshul <[log in to unmask]> wrote:

Anderson,

 

Just following up on this.  I confirmed with a very simple case that there is an extra file needed in the mask list.  I shortened my design matrix to 4 subjects, and got setup_masks to run successfully with a list of 5 mask files (the last one was a dummy file with all zeros).  Here are the input and output design matrices and you can see that the new design matrix has 5 lines, rather than four.

 

Original file: (note the numbers are obviously wrong, I just used the first four entries from my original large table, but I’m just trying to see what setup_masks will produce).

 

/NumWaves 6

/NumPoints 4

/PPheights 26.7031 0.6875 6.38281 0.17523 3.4375 0.5

/Matrix

19.7031 0.6875 3.3828 0.1752 -0.5625 -0.5000

17.7031 -0.3125 1.3828 0.0752 -0.5625 -0.5000

0.7031 -0.3125 1.3828 0.1752 -0.5625 -0.5000

0.7031 0.6875 0.3828 0.1752 1.4375 -0.5000

 

 

New file:

/NumWaves 9

/NumPoints 5

/Matrix

    1 0 0 0 0

19.7031 0.6875 3.3828 0.1752 -0.5625 -0.5000    0 1 0 0 0

17.7031 -0.3125 1.3828 0.0752 -0.5625 -0.5000   0 0 1 0 0

0.7031 -0.3125 1.3828 0.1752 -0.5625 -0.5000    0 0 0 1 0

0.7031 0.6875 0.3828 0.1752 1.4375 -0.5000      0 0 0 0 1

 

I’m not sure how this will work, since the first entry has fewer columns than the other. 

 

Sorry this is taking so much effort to debug, but I really appreciate the help in figuring this out.  Thanks!

 

Mark

____________________
Mark Wagshul, PhD
Associate Professor
Gruss Magnetic Resonance Research Center
Albert Einstein College of Medicine
Bronx, NY 10461

Ph: 718-430-4011

FAX: 718-430-3399

Email: [log in to unmask]

 

<image005.jpg>

This email message and any accompanying attachments may contain privileged information intended only for the named recipient(s). If you are not the intended recipient(s), you are hereby notified that the dissemination, distribution, and or copying of this message is strictly prohibited. If you receive this message in error, or are not the named recipient(s), please notify the sender at the email address above, delete this email from your computer, and destroy any copies in any form immediately.

 

 

From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On Behalf Of Mark Wagshul
Sent: Thursday, August 10, 2017 12:08 PM


To: [log in to unmask]
Subject: Re: [FSL] handling of zeros in randomise

 

 

Anderson,

 

I have double checked this and I am completely sure that I am entering the right number of mask files, and yet it is failing as before.  Re the email I send earlier, the reason I thought I was off, was because I found that it would run if I added one additional mask to the list (just a copy of the last one).  So, it seems that it is only working if there are n+1 masks in the list.

 

Mark

 

____________________
Mark Wagshul, PhD
Associate Professor
Gruss Magnetic Resonance Research Center
Albert Einstein College of Medicine
Bronx, NY 10461

Ph: 718-430-4011

FAX: 718-430-3399

Email: [log in to unmask]

 

<image003.jpg>

This email message and any accompanying attachments may contain privileged information intended only for the named recipient(s). If you are not the intended recipient(s), you are hereby notified that the dissemination, distribution, and or copying of this message is strictly prohibited. If you receive this message in error, or are not the named recipient(s), please notify the sender at the email address above, delete this email from your computer, and destroy any copies in any form immediately.

 

 

From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On Behalf Of Anderson M. Winkler
Sent: Wednesday, August 9, 2017 9:53 PM
To: [log in to unmask]
Subject: Re: [FSL] handling of zeros in randomise

 

Hi Mark,

 

Could you double check that you didn't enter the design matrix (.mat file) twice when invoking setup_masks? That seems to be the case from the command line you showed.

 

All the best,

 

Anderson

 

 

On 9 August 2017 at 13:58, Mark Wagshul <[log in to unmask]> wrote:

Anderson,

 

 

Thanks.  Unfortunately, this did not work.  I got the following error.  Have attached the design and contrast matrix files, in case you’d like to look at it, but I’m pretty sure these are configured correctly.

 

“ERROR:: design matrix of different size to number of masks specified”

 

The command used to run setup_masks as “setup_masks ICVF_Q1vsQ4_124subj_2017Aug09.mat ICVF_Q1vsQ4_124subj_2017Aug09.mat ICVF_Q1vsQ4_124subj_2017Aug09_masked mask1 mask2 … mask124”.

 

Can it not handle this large a dataset?  Thanks for any advice you can provide.

 

Mark

____________________
Mark Wagshul, PhD
Associate Professor
Gruss Magnetic Resonance Research Center
Albert Einstein College of Medicine
Bronx, NY 10461

Ph: 718-430-4011

FAX: 718-430-3399

Email: [log in to unmask]

 

<image003.jpg>

This email message and any accompanying attachments may contain privileged information intended only for the named recipient(s). If you are not the intended recipient(s), you are hereby notified that the dissemination, distribution, and or copying of this message is strictly prohibited. If you receive this message in error, or are not the named recipient(s), please notify the sender at the email address above, delete this email from your computer, and destroy any copies in any form immediately.

 

 

From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On Behalf Of Anderson M. Winkler
Sent: Wednesday, August 9, 2017 9:22 AM


To: [log in to unmask]
Subject: Re: [FSL] handling of zeros in randomise

 

Hi Mark,

 

That's exactly it. For subject with no lesions, use an all zeroes mask (i.e., a blank volume).

 

All the best,

 

Anderson

 

 

On 7 August 2017 at 10:30, Mark Wagshul <[log in to unmask]> wrote:

Anderson,

 

Sorry, I just noticed this response from you.  I did see that comment, but didn’t have time to look carefully into this option.  I now understand what you mean and will try this out.  You’re right, I think this is exactly what we need to run.

 

Just to clarify how setup_masks works – I have to specify a mask for each volume, irrespective of whether or not I want to mask that volume (since it requires the masks to be in the same order as the images in the input image).  Not quite sure what the EV’s will look like, since the EV’s are now images (masks), but I guess it generates these automatically, so I will find out once it runs.

 

Thanks for the help!

 

Mark

 

____________________
Mark Wagshul, PhD
Associate Professor
Gruss Magnetic Resonance Research Center
Albert Einstein College of Medicine
Bronx, NY 10461

Ph: 718-430-4011

FAX: 718-430-3399

Email: [log in to unmask]

 

<image003.jpg>

This email message and any accompanying attachments may contain privileged information intended only for the named recipient(s). If you are not the intended recipient(s), you are hereby notified that the dissemination, distribution, and or copying of this message is strictly prohibited. If you receive this message in error, or are not the named recipient(s), please notify the sender at the email address above, delete this email from your computer, and destroy any copies in any form immediately.

 

 

From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On Behalf Of Anderson M. Winkler
Sent: Sunday, July 30, 2017 4:10 PM


To: [log in to unmask]
Subject: Re: [FSL] handling of zeros in randomise

 

Hi Mark,

 

Have you considered setup_masks that I commented in the earlier email? It should do what you need...

 

All the best,

 

Anderson

 

 

On 27 July 2017 at 18:12, Mark Wagshul <[log in to unmask]> wrote:

Thanks, Anderson (sorry for the delayed response!).

 

So, if I understand you correctly, it is NOT possible to ignore the zeros with randomize and the best approach would be to leave the non-physical values in.  This will work for FA, since most of these problematic voxels are areas where there are imperfections in a few of the directions (or where the imperfection is in the b=0 image, such that its value is lower than some of the b~=0 images).  In this case, the FA will be slightly above 1, but as you suggest the actual value is still likely high.  

 

This will unfortunately not work for NODDI.  Many of the errors in these maps give values which are way off, e.g. ICVF << 0, and are likely due to imperfections in the data which lead to erroneous fitting of the NODDI model.  In these cases, I think it’s unwise to leave the data as is since these will look like extreme parameter values for this subject, and the real solution would be to zero out those voxels for only that subject.  But, it seems that this feature is not available for randomize, so that the only way to prevent erroneous results in these voxels is to zero them out for all subjects.  Would this be your recommendation as well?

 

Thanks for any further advice you can provide.

 

Best,

 

Mark

 

____________________
Mark Wagshul, PhD
Associate Professor
Gruss Magnetic Resonance Research Center
Albert Einstein College of Medicine
Bronx, NY 10461

Ph: 718-430-4011

FAX: 718-430-3399

Email: [log in to unmask]

 

<image004.jpg>

This email message and any accompanying attachments may contain privileged information intended only for the named recipient(s). If you are not the intended recipient(s), you are hereby notified that the dissemination, distribution, and or copying of this message is strictly prohibited. If you receive this message in error, or are not the named recipient(s), please notify the sender at the email address above, delete this email from your computer, and destroy any copies in any form immediately.

 

 

From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On Behalf Of Anderson M. Winkler
Sent: Tuesday, July 18, 2017 11:27 AM
To: [log in to unmask]
Subject: Re: [FSL] handling of zeros in randomise

 

Hi Mark,

 

Please see below:

 

On 17 July 2017 at 14:46, Mark Wagshul <[log in to unmask]> wrote:

Dear FSL experts,

How does randomise handle zeros in the parameter maps?  I am analyzing DTI and NODDI data and there are instances where the parameter maps contain values which are non-physical (e.g. FA > 1).  I would like to zero out these data points for this subject alone, rather than masking out the voxel for all subjects.  Is this possible, or will randomise still calculate the statistics based on this subject with a value of zero?

 

I think you can leave these values as is, i.e., even if non-physical, they are still the best estimate of the diffusion parameters given the data, and randomise can benefit from them if you leave them there.

 

Zeroeing out or removing will be worse as the value randomise will see is much farther from the reality than the non-physical value. Say the true (unseen) FA value is 0.95, and the estimate found was 1.06 (non-physical). This 1.06 is closer to the truth than 0. Removing the voxel from the analysis (see the script setup_masks) may be just as bad, as the 1.06 provides some information (i.e., that FA is high for this subject), whereas knocking the voxel out will toss that information away.

 


Obviously, if it were possible to exclude individual subjects with zeroed-out data this will change the number of degrees of freedom across the image, but for a large enough sample (> 50 subjects per group), and assuming the zeros are occurring in random locations due to imperfections in the data, this should be a pretty small effect (alternatively, randomise may be able to handle the varying DOF's across the image).

 

The script setup_masks is useful for this purpose. If the DOF becomes a problem, it's possible to make small syntax changes and run using PALM with the option "-zstat", that will remove the dependency on the DOF.

 

Hope this helps!

 

All the best,

 

Anderson

 


Any advice you can give me on this would be much appreciated.

Thanks,

Mark Wagshul

 

 

 

 

 

<image005.jpg><image003.jpg><image003.jpg><image003.jpg><image004.jpg>