From sorench at gmail.com Thu Mar 1 02:13:27 2007 From: sorench at gmail.com (Soren Christensen) Date: Thu, 1 Mar 2007 18:13:27 +1100 Subject: [MINC-users] permuting dimension In-Reply-To: References: Message-ID: Thanks again! 1. worked - minctoraw, rawtominc and a minccopyheader (copies header from another minc) followed by reediting the step sizes solved it. Cheers Soren On 3/1/07, Andrew Janke wrote: > > Two methods... > > 1. (what you suggest, minctoraw and then back in). > > 2. Evil tricks with mincedit using the editor argument in which you > specify the editor as sed or the likes. > > ie: > > mincedit foo.mnc "sed -e 's/xspace/yspace/'" > > Note that I haven't checked the above! And of course you will need to > use an intermediate step to swap dimensions. > > > a > > On 3/1/07, Soren Christensen wrote: > > Hi, > > Is there an easy way to permute dimension of a minc file or is it > necessary > > to extract the raw data and re-generate the file. > > I have a few perfusion dicom data sets where it seems the dicom header > is > > simply wrong - so i get something like this: > > dimension name length step start > > -------------- ------ ---- ----- > > time 40 unknown unknown > > yspace 12 9.1 -123.327 > > zspace 128 -1.875 -16.2219 > > xspace 128 -1.875 -120.938 > > > > yspace and zspace are swapped around (z is indeed the lowest res > dimention) > > so basically my question is how do I unswap them in the easiest way? > > > > Thanks > > Soren > > _______________________________________________ > > MINC-users at bic.mni.mcgill.ca > > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > > > > -- > Andrew Janke (a.janke at gmail.com || http://a.janke.googlepages.com/) > Canberra->Australia +61 (402) 700 883 > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From sorench at gmail.com Sun Mar 11 04:41:30 2007 From: sorench at gmail.com (Soren Christensen) Date: Sun, 11 Mar 2007 20:41:30 +1100 Subject: [MINC-users] mnc2nii, orientation of nii file Message-ID: Hi, I have a coronal MRI that are have re-oriented to x,y,z data-order with all posetive stepsizes as described by Andrew on http://brainbody.nottingham.ac.uk/users/wiki/pmwiki.php?n=MincUsersGroup.FAQDataFormats The directional cosines are othogonal, posetive and increasing in the size of the dimension (eg 1,0,0 for x). When I run mnc2nii the resulting nifti files comes out as neurological. I'd like it to be radiological since FSL seems to not be completely independent of the voxel data storage order. Is there something I can do to make mnc2nii output it radiologically? I thought that reshaping with -xdirection might work but it doesn't. Alternatively I guess I could change the nii file order+orienteation using the FSL tools but I'd like to understand why it does not seem possible with mnc2nii. Thanks Soren From a.janke at gmail.com Sun Mar 11 06:07:17 2007 From: a.janke at gmail.com (Andrew Janke) Date: Sun, 11 Mar 2007 22:07:17 +1100 Subject: [MINC-users] mnc2nii, orientation of nii file In-Reply-To: References: Message-ID: Hi Soren, Radio vs Neuro _should_ be something that concerns display of an image only. Certain other packages think differently... :) MINC will never allow you to "flip" data about in a file unless you specificaly transform it or do some dodgy tricks as will be illustrated in the file I am attaching! What you are doing with the -xdirection is to flip the voxel data about and _also_ flip the step direction, so the data ends up the same as what it was. That all said, use the script below (that I call volflip) to achieve what you want. (I think I turned attachments off on this list) a ----- cut here ---- #! /usr/bin/env perl # # Andrew Janke - rotor at cmr.uq.edu.au # Center for Magnetic Resonance # The University of Queensland # http://www.cmr.uq.edu.au/~rotor # # Copyright Andrew Janke, The University of Queensland. # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies. The # author and the University of Queensland make no representations about the # suitability of this software for any purpose. It is provided "as is" # without express or implied warranty. use strict; use warnings "all"; use Getopt::Tabular; use File::Basename; use File::Temp qw/ tempdir /; my($Help, $Usage, $me); my(@opt_table, %opt, $infile, $outfile, @args, $tmpdir); $me = &basename($0); %opt = ( 'verbose' => 0, 'clobber' => 0, 'fake' => 0, 'direction' => 'x', ); $Help = < 1, CLEANUP => 1 ); my($step); # get file start and step info chomp($step = `mincinfo -attvalue $opt{direction}space:step $infile`); # first make sure we don't get bitten by slice normalisation &do_cmd('mincreshape', '-clobber', '-normalize', $infile, "$tmpdir/nrm.mnc"); # reshape &do_cmd('mincreshape', '-clobber', '-dimsize', "$opt{direction}space=-1", ($step > 0) ? "-$opt{direction}direction" :"+$opt{direction}direction", "$tmpdir/nrm.mnc", "$tmpdir/res.mnc"); # create template image and copy data &do_cmd('cp', '-f', "$tmpdir/nrm.mnc", $outfile); &do_cmd('minccopy', "$tmpdir/res.mnc", $outfile); sub do_cmd { print STDOUT "@_\n" if $opt{verbose}; if(!$opt{fake}){ system(@_) == 0 or die; } } --- fin --- On 3/11/07, Soren Christensen wrote: > Hi, > I have a coronal MRI that are have re-oriented to x,y,z data-order > with all posetive stepsizes as described by Andrew on > http://brainbody.nottingham.ac.uk/users/wiki/pmwiki.php?n=MincUsersGroup.FAQDataFormats > > The directional cosines are othogonal, posetive and increasing in the > size of the dimension (eg 1,0,0 for x). > > When I run mnc2nii the resulting nifti files comes out as neurological. > I'd like it to be radiological since FSL seems to not be completely > independent of the voxel data storage order. > > Is there something I can do to make mnc2nii output it radiologically? > I thought that reshaping with -xdirection might work but it doesn't. > > Alternatively I guess I could change the nii file order+orienteation > using the FSL tools but I'd like to understand why it does not seem > possible with mnc2nii. > > Thanks > Soren > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > -- Andrew Janke (a.janke at gmail.com || http://a.janke.googlepages.com/) Canberra->Australia +61 (402) 700 883 From sorench at gmail.com Sun Mar 11 06:54:05 2007 From: sorench at gmail.com (Soren Christensen) Date: Sun, 11 Mar 2007 22:54:05 +1100 Subject: [MINC-users] mnc2nii, orientation of nii file In-Reply-To: References: Message-ID: Hi Andrew, Thanks for that, will try out but I might just stick with doing the "radiologicalisation" in FSL to keep the MINC file correct. After some thinking I think I understand that radiological is a display issue. I guess there is a mapping from voxels coordinates to real world coordinates and then there is a mapping onto the display on top of that (determining if we see the data radiologically or neurologically). It seems the two mappings are often lumped together leading to a lot of confusion. Thanks for the help! Soren On 3/11/07, Andrew Janke wrote: > Hi Soren, > > > Radio vs Neuro _should_ be something that concerns display of an image only. > Certain other packages think differently... :) > > > MINC will never allow you to "flip" data about in a file unless you > specificaly transform it or do some dodgy tricks as will be > illustrated in the file I am attaching! > > What you are doing with the -xdirection is to flip the voxel data > about and _also_ flip the step direction, so the data ends up the same > as what it was. > > That all said, use the script below (that I call volflip) to achieve > what you want. (I think I turned attachments off on this list) > > > a > > > ----- cut here ---- > > #! /usr/bin/env perl > # > # Andrew Janke - rotor at cmr.uq.edu.au > # Center for Magnetic Resonance > # The University of Queensland > # http://www.cmr.uq.edu.au/~rotor > # > # Copyright Andrew Janke, The University of Queensland. > # Permission to use, copy, modify, and distribute this software and its > # documentation for any purpose and without fee is hereby granted, > # provided that the above copyright notice appear in all copies. The > # author and the University of Queensland make no representations about the > # suitability of this software for any purpose. It is provided "as is" > # without express or implied warranty. > > use strict; > use warnings "all"; > use Getopt::Tabular; > use File::Basename; > use File::Temp qw/ tempdir /; > > my($Help, $Usage, $me); > my(@opt_table, %opt, $infile, $outfile, @args, $tmpdir); > > $me = &basename($0); > %opt = ( > 'verbose' => 0, > 'clobber' => 0, > 'fake' => 0, > 'direction' => 'x', > ); > > $Help = < | $me flips a volume about its centre (volume not world) there > | are far easier ways to flip a volume about its world centre > | than this. > | > | Problems or comments should be sent to: rotor\@cmr.uq.edu.au > HELP > > $Usage = "Usage: $me [options] \n". > " $me -help to list options\n\n"; > > @opt_table = ( > ["-verbose", "boolean", 0, \$opt{verbose}, > "be verbose" ], > ["-clobber", "boolean", 0, \$opt{clobber}, > "clobber existing check files" ], > ["-fake", "boolean", 0, \$opt{fake}, > "do a dry run, (echo cmds only)" ], > > ["-x", "const", 'x', \$opt{direction}, > "flip volume in x-plane (default)" ], > ["-y", "const", 'y', \$opt{direction}, > "flip volume in y-plane" ], > ["-z", "const", 'z', \$opt{direction}, > "flip volume in z-plane" ], > ); > > # check args > &Getopt::Tabular::SetHelp($Help, $Usage); > &GetOptions(\@opt_table, \@ARGV) || exit 1; > die $Usage if($#ARGV != 1); > $infile = shift(@ARGV); > $outfile = shift(@ARGV); > > # check for files > die "$me: Couldn't find input file: $infile\n" if (!-e $infile); > if(-e $outfile && !$opt{clobber}){ > die "$me: $outfile exists, -clobber to overwrite\n"; > } > > # make tmpdir > $tmpdir = &tempdir( "$me-XXXXXXXX", TMPDIR => 1, CLEANUP => 1 ); > > my($step); > > # get file start and step info > chomp($step = `mincinfo -attvalue $opt{direction}space:step $infile`); > > # first make sure we don't get bitten by slice normalisation > &do_cmd('mincreshape', '-clobber', > '-normalize', > $infile, "$tmpdir/nrm.mnc"); > # reshape > &do_cmd('mincreshape', '-clobber', > '-dimsize', "$opt{direction}space=-1", > ($step > 0) ? "-$opt{direction}direction" :"+$opt{direction}direction", > "$tmpdir/nrm.mnc", "$tmpdir/res.mnc"); > > # create template image and copy data > &do_cmd('cp', '-f', "$tmpdir/nrm.mnc", $outfile); > &do_cmd('minccopy', "$tmpdir/res.mnc", $outfile); > > > sub do_cmd { > print STDOUT "@_\n" if $opt{verbose}; > if(!$opt{fake}){ > system(@_) == 0 or die; > } > } > > > > --- fin --- > > > On 3/11/07, Soren Christensen wrote: > > Hi, > > I have a coronal MRI that are have re-oriented to x,y,z data-order > > with all posetive stepsizes as described by Andrew on > > http://brainbody.nottingham.ac.uk/users/wiki/pmwiki.php?n=MincUsersGroup.FAQDataFormats > > > > The directional cosines are othogonal, posetive and increasing in the > > size of the dimension (eg 1,0,0 for x). > > > > When I run mnc2nii the resulting nifti files comes out as neurological. > > I'd like it to be radiological since FSL seems to not be completely > > independent of the voxel data storage order. > > > > Is there something I can do to make mnc2nii output it radiologically? > > I thought that reshaping with -xdirection might work but it doesn't. > > > > Alternatively I guess I could change the nii file order+orienteation > > using the FSL tools but I'd like to understand why it does not seem > > possible with mnc2nii. > > > > Thanks > > Soren > > _______________________________________________ > > MINC-users at bic.mni.mcgill.ca > > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > > > > -- > Andrew Janke (a.janke at gmail.com || http://a.janke.googlepages.com/) > Canberra->Australia +61 (402) 700 883 > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > From a.janke at gmail.com Sun Mar 11 06:59:02 2007 From: a.janke at gmail.com (Andrew Janke) Date: Sun, 11 Mar 2007 22:59:02 +1100 Subject: [MINC-users] mnc2nii, orientation of nii file In-Reply-To: References: Message-ID: Correct! Of course the original Radio vs Neuro thnig only came about when a surgeon (who we presume was a neurologist) decided to put the X-Ray "the other way" on a viewer because they were operating from the head of the patient! :) a On 3/11/07, Soren Christensen wrote: > Hi Andrew, > Thanks for that, will try out but I might just stick with doing the > "radiologicalisation" in FSL to keep the MINC file correct. > > After some thinking I think I understand that radiological is a display issue. > I guess there is a mapping from voxels coordinates to real world > coordinates and then there is a mapping onto the display on top of > that (determining if we see the data radiologically or > neurologically). It seems the two mappings are often lumped together > leading to a lot of confusion. > > Thanks for the help! > > Soren > > > On 3/11/07, Andrew Janke wrote: > > Hi Soren, > > > > > > Radio vs Neuro _should_ be something that concerns display of an image only. > > Certain other packages think differently... :) > > > > > > MINC will never allow you to "flip" data about in a file unless you > > specificaly transform it or do some dodgy tricks as will be > > illustrated in the file I am attaching! > > > > What you are doing with the -xdirection is to flip the voxel data > > about and _also_ flip the step direction, so the data ends up the same > > as what it was. > > > > That all said, use the script below (that I call volflip) to achieve > > what you want. (I think I turned attachments off on this list) > > > > > > a > > > > > > ----- cut here ---- > > > > #! /usr/bin/env perl > > # > > # Andrew Janke - rotor at cmr.uq.edu.au > > # Center for Magnetic Resonance > > # The University of Queensland > > # http://www.cmr.uq.edu.au/~rotor > > # > > # Copyright Andrew Janke, The University of Queensland. > > # Permission to use, copy, modify, and distribute this software and its > > # documentation for any purpose and without fee is hereby granted, > > # provided that the above copyright notice appear in all copies. The > > # author and the University of Queensland make no representations about the > > # suitability of this software for any purpose. It is provided "as is" > > # without express or implied warranty. > > > > use strict; > > use warnings "all"; > > use Getopt::Tabular; > > use File::Basename; > > use File::Temp qw/ tempdir /; > > > > my($Help, $Usage, $me); > > my(@opt_table, %opt, $infile, $outfile, @args, $tmpdir); > > > > $me = &basename($0); > > %opt = ( > > 'verbose' => 0, > > 'clobber' => 0, > > 'fake' => 0, > > 'direction' => 'x', > > ); > > > > $Help = < > | $me flips a volume about its centre (volume not world) there > > | are far easier ways to flip a volume about its world centre > > | than this. > > | > > | Problems or comments should be sent to: rotor\@cmr.uq.edu.au > > HELP > > > > $Usage = "Usage: $me [options] \n". > > " $me -help to list options\n\n"; > > > > @opt_table = ( > > ["-verbose", "boolean", 0, \$opt{verbose}, > > "be verbose" ], > > ["-clobber", "boolean", 0, \$opt{clobber}, > > "clobber existing check files" ], > > ["-fake", "boolean", 0, \$opt{fake}, > > "do a dry run, (echo cmds only)" ], > > > > ["-x", "const", 'x', \$opt{direction}, > > "flip volume in x-plane (default)" ], > > ["-y", "const", 'y', \$opt{direction}, > > "flip volume in y-plane" ], > > ["-z", "const", 'z', \$opt{direction}, > > "flip volume in z-plane" ], > > ); > > > > # check args > > &Getopt::Tabular::SetHelp($Help, $Usage); > > &GetOptions(\@opt_table, \@ARGV) || exit 1; > > die $Usage if($#ARGV != 1); > > $infile = shift(@ARGV); > > $outfile = shift(@ARGV); > > > > # check for files > > die "$me: Couldn't find input file: $infile\n" if (!-e $infile); > > if(-e $outfile && !$opt{clobber}){ > > die "$me: $outfile exists, -clobber to overwrite\n"; > > } > > > > # make tmpdir > > $tmpdir = &tempdir( "$me-XXXXXXXX", TMPDIR => 1, CLEANUP => 1 ); > > > > my($step); > > > > # get file start and step info > > chomp($step = `mincinfo -attvalue $opt{direction}space:step $infile`); > > > > # first make sure we don't get bitten by slice normalisation > > &do_cmd('mincreshape', '-clobber', > > '-normalize', > > $infile, "$tmpdir/nrm.mnc"); > > # reshape > > &do_cmd('mincreshape', '-clobber', > > '-dimsize', "$opt{direction}space=-1", > > ($step > 0) ? "-$opt{direction}direction" :"+$opt{direction}direction", > > "$tmpdir/nrm.mnc", "$tmpdir/res.mnc"); > > > > # create template image and copy data > > &do_cmd('cp', '-f', "$tmpdir/nrm.mnc", $outfile); > > &do_cmd('minccopy', "$tmpdir/res.mnc", $outfile); > > > > > > sub do_cmd { > > print STDOUT "@_\n" if $opt{verbose}; > > if(!$opt{fake}){ > > system(@_) == 0 or die; > > } > > } > > > > > > > > --- fin --- > > > > > > On 3/11/07, Soren Christensen wrote: > > > Hi, > > > I have a coronal MRI that are have re-oriented to x,y,z data-order > > > with all posetive stepsizes as described by Andrew on > > > http://brainbody.nottingham.ac.uk/users/wiki/pmwiki.php?n=MincUsersGroup.FAQDataFormats > > > > > > The directional cosines are othogonal, posetive and increasing in the > > > size of the dimension (eg 1,0,0 for x). > > > > > > When I run mnc2nii the resulting nifti files comes out as neurological. > > > I'd like it to be radiological since FSL seems to not be completely > > > independent of the voxel data storage order. > > > > > > Is there something I can do to make mnc2nii output it radiologically? > > > I thought that reshaping with -xdirection might work but it doesn't. > > > > > > Alternatively I guess I could change the nii file order+orienteation > > > using the FSL tools but I'd like to understand why it does not seem > > > possible with mnc2nii. > > > > > > Thanks > > > Soren > > > _______________________________________________ > > > MINC-users at bic.mni.mcgill.ca > > > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > > > > > > > > -- > > Andrew Janke (a.janke at gmail.com || http://a.janke.googlepages.com/) > > Canberra->Australia +61 (402) 700 883 > > _______________________________________________ > > MINC-users at bic.mni.mcgill.ca > > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > -- Andrew Janke (a.janke at gmail.com || http://a.janke.googlepages.com/) Canberra->Australia +61 (402) 700 883 From alex at bic.mni.mcgill.ca Mon Mar 12 12:39:39 2007 From: alex at bic.mni.mcgill.ca (Alex ZIJDENBOS) Date: Mon, 12 Mar 2007 12:39:39 -0500 Subject: [MINC-users] bug in mritoself Message-ID: <20070312123939.A7226561@bic.mni.mcgill.ca> I just came across what I would consider a bug in mritoself, and which may have affected users of it: if the source and target volumes have the same filename (from two different dirs, obviously), the result will always be the identity transform. This is because of this little bit of code in the Crop sub: $cropped = "${TmpDir}/${base}_${label}.mnc"; return ($cropped, \@crop, \@subsample) if (-e $cropped); which is called the same way for the source and target volumes. As a result the minctracc call which follows will register the same temp file against itself. There are a few different ways to solve this, but a simple one would be to replace ($source_cropped, $source_crop, $source_subsample)= &Crop ($SourceBase, $Source, "crop", $GuessCrop, $GuessSubsample, \@Subsample, \@Crop); ($target_cropped, $target_crop, $target_subsample) = &Crop ($TargetBase, $Target, "crop", $GuessCrop, $GuessSubsample, \@Subsample, \@Crop); with ($source_cropped, $source_crop, $source_subsample)= &Crop ($SourceBase, $Source, "crop_source", $GuessCrop, $GuessSubsample, \@Subsample, \@Crop); ($target_cropped, $target_crop, $target_subsample) = &Crop ($TargetBase, $Target, "crop_target", $GuessCrop, $GuessSubsample, \@Subsample, \@Crop); -- A From se at hst.aau.dk Mon Mar 12 12:54:54 2007 From: se at hst.aau.dk (Simon Fristed Eskildsen) Date: Mon, 12 Mar 2007 18:54:54 +0100 Subject: [MINC-users] mrisim Message-ID: <45F593EE.9020109@hst.aau.dk> Hi, I happily realized that Andrew had put the "mrisim" package on the packages site. However, after successful compilation I could not get any output from the binary. I have earlier used the mrisim version I could checkout from the cvs repository. However, using the exact same input files as to "the old cvs version" the new version complains: Invalid fuzzy label file: bg.mnc for tissue label 0. FATAL ERROR: Could not create phantom. Any idea why there is a difference, and/or how I can get the "official" release to work? I use the options -tissue tissue.prm -coil coil.rf -seq t1_icbm.seq and have the necessary tissue labels in the working dir. I noticed that there is a difference in the dynamic linking of the two binaries. The old one links with libnetcdf.so.3 while the new one does not. Could this be a netcdf problem? Thanks, Simon From a.janke at gmail.com Sun Mar 25 17:07:38 2007 From: a.janke at gmail.com (Andrew Janke) Date: Mon, 26 Mar 2007 07:07:38 +1000 Subject: [MINC-users] bug in mritoself In-Reply-To: <20070312123939.A7226561@bic.mni.mcgill.ca> References: <20070312123939.A7226561@bic.mni.mcgill.ca> Message-ID: Hi Alex, You are well and truly correct that this is a Bug! (and the first in mni_autoreg in a long time too). I have added the change to CVS and will commit and release a new version shortly. Thanks a On 3/13/07, Alex ZIJDENBOS wrote: > I just came across what I would consider a bug in mritoself, and which > may have affected users of it: if the source and target volumes have > the same filename (from two different dirs, obviously), the result > will always be the identity transform. This is because of this little > bit of code in the Crop sub: > > $cropped = "${TmpDir}/${base}_${label}.mnc"; > return ($cropped, \@crop, \@subsample) if (-e $cropped); > > which is called the same way for the source and target volumes. As a > result the minctracc call which follows will register the same temp > file against itself. > > There are a few different ways to solve this, but a simple one would > be to replace > > ($source_cropped, $source_crop, $source_subsample)= > &Crop ($SourceBase, $Source, "crop", > $GuessCrop, $GuessSubsample, \@Subsample, \@Crop); > ($target_cropped, $target_crop, $target_subsample) = > &Crop ($TargetBase, $Target, "crop", > $GuessCrop, $GuessSubsample, \@Subsample, \@Crop); > > with > > ($source_cropped, $source_crop, $source_subsample)= > &Crop ($SourceBase, $Source, "crop_source", > $GuessCrop, $GuessSubsample, \@Subsample, \@Crop); > ($target_cropped, $target_crop, $target_subsample) = > &Crop ($TargetBase, $Target, "crop_target", > $GuessCrop, $GuessSubsample, \@Subsample, \@Crop); > > -- A > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users > -- Andrew Janke (a.janke at gmail.com || http://a.janke.googlepages.com/) Canberra->Australia +61 (402) 700 883 From se at hst.aau.dk Thu Mar 29 09:07:52 2007 From: se at hst.aau.dk (Simon Fristed Eskildsen) Date: Thu, 29 Mar 2007 15:07:52 +0200 Subject: [MINC-users] nu_evaluate crash Message-ID: <460BBA28.10708@hst.aau.dk> Hi all, I just tried to run nu_evaluate and it crashes on mincmath: nu_evaluate -keep -mapping test_N3.imp test.mnc test_N3.mnc [nu_evaluate] [---] [2007-03-29 14:51:06] /gruppe/ad_mri/Opteron/pack/bin/evaluate_field -clobber -verbose -like test.mnc test_N3.imp /var/tmp/nu_evaluate_16514//test_N3_field.mnc Not implemented yet in cache_volume_range_has_changed() Not implemented yet in cache_volume_range_has_changed() [nu_evaluate] [---] [2007-03-29 14:51:10] /gruppe/ad_mri/Opteron/pack/bin/mincmath -clobber -verbose -copy_header -zero -div test.mnc /var/tmp/nu_evaluate_16514//test_N3_field.mnc test_N3.mnc Files /var/tmp/nu_evaluate_16514//test_N3_field.mnc and test.mnc have different coordinate spacings (zspace) nu_evaluate: crashed while running mincmath (termination status=256) The headers reveal that spacing is "irregular" on test.mnc while "regular__" on test_N3_field.mnc I guess this is the problem that causes mincmath to complain. Is this expected behaviour of nu_evaluate? Do I need to make the spacing in input minc file "regular__" ? If so, can I just edit the spacing variable and remove the direction_cosines variable (which I guess is only present in irregular spaced files)? Thanks, Simon From jharlap at bic.mni.mcgill.ca Thu Mar 29 09:19:10 2007 From: jharlap at bic.mni.mcgill.ca (Jonathan HARLAP) Date: Thu, 29 Mar 2007 09:19:10 -0400 Subject: [MINC-users] nu_evaluate crash In-Reply-To: <460BBA28.10708@hst.aau.dk> References: <460BBA28.10708@hst.aau.dk> Message-ID: <460BBCCE.7030400@bic.mni.mcgill.ca> Hi Simon, The direction cosines attribute should always be present, regular or irregular, as it describes the directions of the axes that define the image dimensions. The irregularity has to do with a dimension with nonuniform step sizes. Assuming that the step sizes are basically all the same (within the irregular dimension, I mean) and that the irregularity is insignificant, you can fix it with: mincresample -nearest_neighbour irregular.mnc regular.mnc There are also other ways which have been previously discussed on this mailing list if you want to dig through archives, but just be aware that it is *not* sufficient to simply modify the [xyz]space:spacing attribute to be "regular__" as doing so will leave the irregular spacing information in the [xyz]space variable (`mincheader -data irregular.mnc` to see what I mean). Cheers, J Simon Fristed Eskildsen wrote: > Hi all, > I just tried to run nu_evaluate and it crashes on mincmath: > > nu_evaluate -keep -mapping test_N3.imp test.mnc test_N3.mnc > [nu_evaluate] [---] [2007-03-29 14:51:06] > /gruppe/ad_mri/Opteron/pack/bin/evaluate_field -clobber -verbose -like > test.mnc test_N3.imp /var/tmp/nu_evaluate_16514//test_N3_field.mnc > Not implemented yet in cache_volume_range_has_changed() > Not implemented yet in cache_volume_range_has_changed() > [nu_evaluate] [---] [2007-03-29 14:51:10] > /gruppe/ad_mri/Opteron/pack/bin/mincmath -clobber -verbose -copy_header > -zero -div test.mnc /var/tmp/nu_evaluate_16514//test_N3_field.mnc > test_N3.mnc > Files /var/tmp/nu_evaluate_16514//test_N3_field.mnc and test.mnc have > different coordinate spacings (zspace) > nu_evaluate: crashed while running mincmath (termination status=256) > > The headers reveal that spacing is "irregular" on test.mnc while > "regular__" on test_N3_field.mnc > I guess this is the problem that causes mincmath to complain. > Is this expected behaviour of nu_evaluate? Do I need to make the spacing > in input minc file "regular__" ? If so, can I just edit the spacing > variable and remove the direction_cosines variable (which I guess is > only present in irregular spaced files)? > > Thanks, > Simon > > > ------------------------------------------------------------------------ > > _______________________________________________ > MINC-users at bic.mni.mcgill.ca > http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users From vladimir.fonov at gmail.com Thu Mar 29 11:51:54 2007 From: vladimir.fonov at gmail.com (Vladimir FONOV) Date: Thu, 29 Mar 2007 11:51:54 -0400 Subject: [MINC-users] nu_evaluate crash In-Reply-To: <460BBA28.10708@hst.aau.dk> References: <460BBA28.10708@hst.aau.dk> Message-ID: Hello, On 3/29/07, Simon Fristed Eskildsen wrote: > The headers reveal that spacing is "irregular" on test.mnc while > "regular__" on test_N3_field.mnc > I guess this is the problem that causes mincmath to complain. > Is this expected behaviour of nu_evaluate? Do I need to make the spacing > in input minc file "regular__" ? If so, can I just edit the spacing > variable and remove the direction_cosines variable (which I guess is > only present in irregular spaced files)? No, leave that. You can edit the spacing variable, and force it to be regular: i.e minc_modify_header -sinsert zspace:spacing="regular__" test.mnc -- Best regards, Vladimir S. Fonov ~ vladimir.fonov gmail.com