tag:blogger.com,1999:blog-1405968300258104460.post9074592011835173533..comments2024-03-27T01:18:24.341-04:00Comments on Andy's Brain Blog: Converting T-Maps to Z-MapsAndrew Jahnhttp://www.blogger.com/profile/16435706598096921650noreply@blogger.comBlogger17125tag:blogger.com,1999:blog-1405968300258104460.post-49406670421277560552019-09-24T01:31:07.435-04:002019-09-24T01:31:07.435-04:00Dear Andrew,
Thanks for your helpful video.
Coul...Dear Andrew,<br /><br />Thanks for your helpful video.<br /><br />Could you please make a video about how to sum t-values obtained from contrasts?<br /><br />Thanks<br /><br />Anonymoushttps://www.blogger.com/profile/10538671108835916760noreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-10564226451237255342018-03-06T14:31:07.321-05:002018-03-06T14:31:07.321-05:00Hello,
Use the ttoz command. If you have the t-st...Hello,<br /><br />Use the ttoz command. If you have the t-statistic image - let's call it "tstat.nii.gz" - you will first need to create a volume that only has 1's. You can do this with fslmaths:<br /><br />fslmaths tstat.nii.gz -mul 0 -add 1 allOnes.nii.gz<br /><br />And then use the tstat image and the allOnes image to convert to a z-statistic image:<br /><br />ttoz allOnes.nii.gz tstat1.nii.gz -zout TtoZ.nii.gz<br /><br />Where is the degrees of freedom in your design.<br /><br /><br />Best,<br /><br />-AndyAndrew Jahnhttps://www.blogger.com/profile/16435706598096921650noreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-59379769944228447912018-02-07T05:10:26.886-05:002018-02-07T05:10:26.886-05:00HI there, Im using FSL, which functions/commands s...HI there, Im using FSL, which functions/commands should I use in FSL to convert from t to Z?<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-23870900949233886352016-08-04T13:04:27.172-04:002016-08-04T13:04:27.172-04:00Hello again,
It's working now. Thank you so m...Hello again,<br /><br />It's working now. Thank you so much!!!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-34239547672525738412016-08-04T12:39:30.714-04:002016-08-04T12:39:30.714-04:00I wouldn't bother going that far, just go into...I wouldn't bother going that far, just go into your copy of Andy's script and change:<br /><br />%%% Now load into template and run<br />jobs{1}.util{1}.imcalc.input{1}=[infile '.img,1'];<br />jobs{1}.util{1}.imcalc.output=[outfile '.img'];<br />jobs{1}.util{1}.imcalc.expression=expval;<br /><br />to<br /><br />%%% Now load into template and run<br />jobs{1}.util{1}.imcalc.input{1}=[infile '.nii,1'];<br />jobs{1}.util{1}.imcalc.output=[outfile '.nii'];<br />jobs{1}.util{1}.imcalc.expression=expval;Roger Mullinshttps://www.blogger.com/profile/09056012742924550519noreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-66979656484843276382016-08-04T12:26:16.980-04:002016-08-04T12:26:16.980-04:00Hello there,
I used the spmT.nii How do I convert...Hello there,<br /><br />I used the spmT.nii How do I convert to .img if I need to?<br /><br />Thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-24308579681714809152016-08-04T12:15:10.539-04:002016-08-04T12:15:10.539-04:00In my version I also changed the .img to .nii in t...In my version I also changed the .img to .nii in the jobs specs just because our lab likes .nii. No issues henceforth.Roger Mullinshttps://www.blogger.com/profile/09056012742924550519noreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-90447818298543199372016-08-04T12:12:45.352-04:002016-08-04T12:12:45.352-04:00Is your con_0001 a .nii or .img? It *might* be thr...Is your con_0001 a .nii or .img? It *might* be thrown by the suffix (.img/.nii)<br /><br />However, I suspect you should be using the T map instead of the con if you are running it as T to Z.Roger Mullinshttps://www.blogger.com/profile/09056012742924550519noreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-80997770770876494772016-08-04T11:09:06.274-04:002016-08-04T11:09:06.274-04:00Hi,
I tried running it but the following error co...Hi,<br /><br />I tried running it but the following error comes up:<br /><br />Running 'Image Calculator'<br /><br />SPM12: spm_imcalc (v6124) 16:07:26 - 04/08/2016<br />========================================================================<br />Failed 'Image Calculator'<br />Error using spm_vol>spm_vol_hdr (line 80)<br />File "I:\contrasts\tmap to zmap\con_0001.img" does not exist.<br />In file "C:\spm12\spm12\spm_vol.m" (v5958), function "spm_vol_hdr" at line 80.<br />In file "C:\spm12\spm12\spm_vol.m" (v5958), function "spm_vol" at line 61.<br />In file "C:\spm12\spm12\spm_imcalc.m" (v6124), function "spm_imcalc" at line 99.<br />In file "C:\spm12\spm12\config\spm_cfg_imcalc.m" (v6340), function "my_spm_imcalc" at line 228.<br /><br />The following modules did not run:<br />Failed: Image Calculator<br /><br />Error using MATLABbatch system<br />Job execution failed. The full log of this run can be found in MATLAB command<br />window, starting with the lines (look for the line showing the exact #job as<br />displayed in this error message)<br />------------------<br /><br />Does anyone know how to troubleshoot this?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-91466922048360278192016-08-04T10:20:23.479-04:002016-08-04T10:20:23.479-04:00I found the documentation here: https://github.com...I found the documentation here: https://github.com/casperkaae/MATLAB/blob/master/spm8/spm_t2z.m<br /><br />Seems a bit more involved than Andy's script, statistically.Roger Mullinshttps://www.blogger.com/profile/09056012742924550519noreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-41107100100035216682016-08-04T10:11:28.986-04:002016-08-04T10:11:28.986-04:00Thanks! - works smoothly now.Thanks! - works smoothly now.Roger Mullinshttps://www.blogger.com/profile/09056012742924550519noreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-26108462239145706132016-08-04T10:01:21.328-04:002016-08-04T10:01:21.328-04:00Hi Andy,
I came across this: http://robjellis.net...Hi Andy,<br /><br />I came across this: http://robjellis.net/tools/imcalc_documentation.pdf<br /><br />Is this a faster way of doing a T map to Z map transform using the imcal? But I can't seem to find the expression for the conversion.<br /><br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-79764159465643641942016-08-04T09:57:15.489-04:002016-08-04T09:57:15.489-04:00Hi Andy,
I'm not a matlab user and I'm st...Hi Andy,<br /><br />I'm not a matlab user and I'm struggling to understand what is needed. I literally copied your script onto a notepad file and saved it as .mat<br /><br />Where do I save this .mat file? What do I do next?<br /><br />Thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-73826467291385488712016-08-04T09:48:34.053-04:002016-08-04T09:48:34.053-04:00Hi there,
Did you try running it? I don't thi...Hi there,<br /><br />Did you try running it? I don't think that you'll need the toolbox for any of the functions that it uses. If you can't run it - if the script needs the toolbox for commands like tinv - then see if you can get an administrator to install the toolbox on your computer.<br /><br />-AndyAndrew Jahnhttps://www.blogger.com/profile/16435706598096921650noreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-16119069208246704942016-08-04T09:45:00.783-04:002016-08-04T09:45:00.783-04:00Hey there,
Thanks for pointing that out; that lin...Hey there,<br /><br />Thanks for pointing that out; that line is actually unnecessary. I've updated the script and removed it.<br /><br /><br />-AndyAndrew Jahnhttps://www.blogger.com/profile/16435706598096921650noreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-81914279450803565992016-08-04T09:24:48.102-04:002016-08-04T09:24:48.102-04:00Hi Andrew,
I don't think I have stats toolbox...Hi Andrew,<br /><br />I don't think I have stats toolbox on matlab (I see it as version 8.1 but I don't think I am licensed to use it).<br /><br />How can I convert a T map to a Z map?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1405968300258104460.post-21020210618890727842016-08-03T10:53:01.424-04:002016-08-03T10:53:01.424-04:00This seems very useful, however I am having troubl...This seems very useful, however I am having trouble with this section:<br /><br />%%% Now load into template and run<br />load convert_stat_template.mat<br /><br />Any more detail or an example of what goes into this template?Roger Mullinshttps://www.blogger.com/profile/09056012742924550519noreply@blogger.com