"Images do not all have the same orientation & voxel size" error

944 views
Skip to first unread message

KN

unread,
Mar 1, 2017, 3:06:00 PM3/1/17
to Statistical Nonparametric Mapping
I have been running parametric (standard SPM) second level analyses for a one sample design, but recently was asked to use nonparametric procedures with SnPM on the same dataset.

There are 13 different contrasts that I would like to run for about 25 subjects.

I have been getting the following error when I try to run the analysis on SnPM, but I do not get the error when I run the same analysis using parametric analysis:


Running 'MultiSub: One Sample T test on diffs/contrasts'
Failed 'MultiSub: One Sample T test on diffs/contrasts'
Error using snpm_ui (line 465)
images do not all have same orientation & voxel size
In file "/export/opt/MATLAB/R2013a/toolbox/spm8/toolbox/SnPM13/snpm_ui.m" (???), function "snpm_ui" at line 465.
In file "/export/opt/MATLAB/R2013a/toolbox/spm8/toolbox/SnPM13/config/snpm_run_ui.m" (???), function "snpm_run_ui" at line 12.

Running 'Compute'

SnPM: snpm_cp

----------- I am including some background on the steps I have done which may have caused this error. I've tried my best to follow the existing tutorials, but clearly something is going wrong, and I was hoping someone on this forum would be able to help me with what is hopefully a simple troubleshooting ---------------------------------------------


From SPM, I click on 'Specify 2nd-level' and then select 'MultiSub: One Sample T test' from the SnPM toolbox.

For 'Images to analyze' I select the 25 con_0xxx.img image files from each of the 25 subjects that were generated after 1st level analysis.

The rest of the options are left at default


^^^^ I see the error message when I run the module with these inputs. The error message about brain orientation and voxel size does not appear when I run a parametric test (but shouldn't the same error appear for parametric tests if the orientation and voxel sizes are different per subject?)


Thank you for your help in advance!
KN

Thomas Nichols

unread,
Mar 1, 2017, 5:58:34 PM3/1/17
to Koyuki Nakamura, snpm-support
Hmmm... I'm puzzled, because SnPM should use the exact same algorithm as SPM to test for orientation.

The following will give me all the orientation info about the images (but none of the actual image data):

P=spm_select(Inf,'image','Please select some images');
V=spm_vol(P);
save ImgHandles V

If you send me ImgHandles.mat I'll be able to better diagnose this.

-Tom



On Wed, Mar 1, 2017 at 10:29 PM, Koyuki Nakamura <kn...@cornell.edu> wrote:
Hi Dr. Nichols, 

I checked the files again and it didn't produce any SnPM_cfg.mat files with the 25 subjects. I apologize for the confusion, there was an artifact spnm file that I didn't erase. I reran everything again and this is what's happening: 

Inline image 1

This is what I input into the module. The 25 files were from the files generated after 1st level analysis is complete. 

When I run this, I see this message: 

Inline image 2

I admit I'm not very savvy on fMRI analysis in general, and, wondering if I was using the wrong image files for this analysis I tried it with a single con_000x.img image file that was generated after running 2nd Level analysis on 25 subjects using parametric analysis to see if I would still get the same "not same orientation" message. <-- This was how the SnPM_cfg.mat files were generated which is why the module was able to move forward to 'Compute', which is what the original error message I pasted onto the forum contained. 

You can see from the above screenshot that the module doesn't run and therefore no files are generated at all. When I do the same thing with parametric analysis (see screenshot below) it is able to run just fine: 

Inline image 3


Thank you for your patience and help! 


On Wed, Mar 1, 2017 at 4:37 PM, Koyuki Nakamura <kn...@cornell.edu> wrote:
Thank you so much for getting back to me so quickly! I am double checking with the PIs to make sure they are okay with sending these files to you and will hopefully get back to you soon.


On Wednesday, March 1, 2017, Thomas Nichols <ess...@live.warwick.ac.uk> wrote:
Can you send the SnPM_cfg.mat file that gets created and, if any, SnPM.mat?

KN

--
You received this message because you are subscribed to the Google Groups "Statistical Nonparametric Mapping" group.
To unsubscribe from this group and stop receiving emails from it, send an email to snpm-support+unsubscribe@googlegroups.com.
To post to this group, send an email to snpm-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/snpm-support.
To view this discussion on the web, visit https://groups.google.com/d/msgid/snpm-support/7ebf43cc-8731-4c4f-8eed-f81a511f68b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
__________________________________________________________
Thomas Nichols, PhD
Professor, Head of Neuroimaging Statistics
Department of Statistics & Warwick Manufacturing Group
University of Warwick, Coventry  CV4 7AL, United Kingdom

Email: t.e.n...@warwick.ac.uk
Tel, Stats: +44 24761 51086, WMG: +44 24761 50752
Fx,  +44 24 7652 4532



--
Sent from Gmail Mobile




--
__________________________________________________________
Thomas Nichols, PhD
Professor, Head of Neuroimaging Statistics
Department of Statistics & Warwick Manufacturing Group
University of Warwick, Coventry  CV4 7AL, United Kingdom

Email: t.e.n...@warwick.ac.uk
Tel, Stats: +44 24761 51086, WMG: +44 24761 50752
Fx,  +44 24 7652 4532

Koyuki Nakamura

unread,
Mar 10, 2017, 11:46:02 AM3/10/17
to Thomas Nichols, snpm-s...@googlegroups.com
Hi Dr. Nichols, 

I was worried my last message may not have reached you, and am sending this email just in case. 
I understand you are busy, thank you so much for your assistance!

Best, 
Koyuki

On Thu, Mar 2, 2017 at 12:48 PM, Koyuki Nakamura <kn...@cornell.edu> wrote:
Hi Dr. Nichols, 

I am sending you the ImgHandles.mat file. 
I also received an okay from my PIs about sending you additional files if it helps diagnose the problem (please let me know if any other files will help). 

Thank you so much for your assistance so far! 

You received this message because you are subscribed to a topic in the Google Groups "Statistical Nonparametric Mapping" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/snpm-support/Vg9GJ-ivJWI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to snpm-support+unsubscribe@googlegroups.com.
To post to this group, send email to snpm-s...@googlegroups.com.

Thomas Nichols

unread,
Mar 11, 2017, 3:33:41 PM3/11/17
to Koyuki Nakamura, snpm-support
Dear Koyuki,

I'm so sorry for the delay.  In fact, your images have slight differences in their orientations...
>> load ImgHandles.mat
>> V(18).mat-V(19).mat 

ans =

   1.0e-04 *

    0.0095         0         0   -0.2384
         0    0.0095         0   -0.3147
         0         0    0.0095   -0.2384
         0         0         0         0

... but SPM now allows for some small variation in this whereas SnPM doesn't allow any variation.  

I will issue a fix, but for now you can replace your snpm_ui.m file with the one attached, or edit your snpm_ui.m so where it has

%-Check compatability of images (Bombs for single image)
%-----------------------------------------------------------------------
if any(any(diff(cat(1,V(:).dim),1,1),1)&[1,1,1])
        error('images do not all have the same dimensions')
end
if any(any(any(diff(cat(3,V(:).mat),1,3),3)))
        error('images do not all have same orientation & voxel size')
end

it now reads
spm_check_orientations(V);
 
Let me know if this works out.

-Tom

To post to this group, send email to snpm-s...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
snpm_ui.m

Koyuki Nakamura

unread,
Mar 11, 2017, 8:11:56 PM3/11/17
to Thomas Nichols, snpm-support
Thank you! I will test this as soon as possible on Monday when I have access to our servers that have spss+spnm. 

In terms of analysis, are there any major issues if orientation is slightly off? 


Thomas Nichols

unread,
Mar 12, 2017, 5:10:05 PM3/12/17
to Koyuki Nakamura, snpm-support
No no... I wont worry about it. 
If John Ashbuner (SPM) is OK with this level of wiggle then I'm ok with it.

-Tom
To unsubscribe from this group and stop receiving emails from it, send an email to snpm-support...@googlegroups.com.

To post to this group, send email to snpm-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/snpm-support.

Koyuki Nakamura

unread,
Mar 14, 2017, 11:44:40 AM3/14/17
to Thomas Nichols, snpm-support
It ran with no issues this time. Thank you so much for your help and quick response! 
We are very happy that this tool exists for SPM. 

Koyuki

To unsubscribe from this group and stop receiving emails from it, send an email to snpm-support+unsubscribe@googlegroups.com.

To post to this group, send email to snpm-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/snpm-support.
Reply all
Reply to author
Forward
0 new messages