BIC-MNI / minc-tools

Basic minc-tools from former minc repository
Other
30 stars 25 forks source link

ana2mnc_xfm_reduce.pl reports perl scope errors? #39

Open gdevenyi opened 8 years ago

gdevenyi commented 8 years ago

I think perl got stricter about formatting between the writing of this code and now.

Paging @andrewjanke is this tool more reliable than ana2mnc for handling SPM files?

/home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl -help
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 60.
syntax error at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 61, near "$h"
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 61.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 62.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 63.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 65.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 66.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 67.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 68.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 69.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 70.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 71.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 72.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 73.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 74.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 75.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 76.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 77.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 78.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 79.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 80.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 81.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 82.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 84.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 85.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 86.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 87.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 88.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 89.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 90.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 91.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 92.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 93.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 94.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 95.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 96.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 97.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 98.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 99.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 100.
Global symbol "$h" requires explicit package name at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 101.
syntax error at /home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl line 102, near "}"
/home/cic/devgab/projects/src/minc-tools/conversion/ana2mnc/ana2mnc_xfm_reduce.pl has too many errors.
andrewjanke commented 8 years ago

Hi Gabriel,

As I recall the purpose of this was to dissociate the orientation and "registration" parts of the .mat file. SPM combines these so if you just convert the whole thing many of the MINC tools fail as rotations are more than 90deg. In effect you will always end up with a ZYX volume but the orientation might be sagittal via a rotation matrix. This was causing me problems so I set out to solve it.

The Heuristic I decided upon was that any rotations more than 90deg were to do with orientation and the rest was registration. So the >90deg parts would be mapped to ZYX->YXZ or something else as appropriate and the rest would be kept as a .xfm

Thus the major difference is all the xfm reduction code:

https://github.com/BIC-MNI/minc-tools/blob/master/conversion/ana2mnc/ana2mnc_xfm_reduce.pl#L659

gdevenyi commented 8 years ago

Cool, I see what you mean by realign vs register.