[MINC-users] bug in mritoself
Andrew Janke
a.janke at gmail.com
Sun Mar 25 17:07:38 EDT 2007
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 <alex at bic.mni.mcgill.ca> 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
More information about the MINC-users
mailing list