[Insight-developers] utjOrientedImage.h

Hans Johnson hans-johnson at uiowa.edu
Sat Jul 26 08:24:33 EDT 2008


Bill,

Thanks for the update. I've assigned it to
http://public.kitware.com/Bug/view.php?id=7406


== Will the following two methods produce identical images when written to
disk?

1)
Assume myimage has direction cosigns of [1 0 0; 0 0 -1; 0 1 0]
Assume myidentity is an affine identity matrix;

ResampleImageFilter->SetInput(myimage);
ResampleImageFilter->SetTransform(myidentity);
myoutput=ResampleImageFilter->GetOutput();
myoutput1->SetDirections(myidentity);

2)
Assume myimage has direction cosigns of [1 0 0; 0 0 -1; 0 1 0]
Assume myaffine is an affine identity matrix;

myaffine=myimage->GetDirections();
myimage->SetDirection(myidentity);
ResampleImageFilter->SetInput(myimage);
ResampleImageFilter->SetTransform(myaffine);
myoutput2=ResampleImageFilter->GetOutput();

===========================================================================

Thanks,
Hans

-- 
Hans J. Johnson, Ph.D.
Hans-johnson at uiowa.edu

278 GH
The University of Iowa
Iowa City, IA 52241
(319) 353 8587


> From: Bill Lorensen <bill.lorensen at gmail.com>
> Date: Fri, 25 Jul 2008 22:22:26 -0400
> To: Hans Johnson <hans.j.johnson at gmail.com>
> Cc: ITK <insight-developers at itk.org>
> Subject: Re: [Insight-developers] utjOrientedImage.h
> 
> Hans,
> 
> The OrientedImage uses an image direction cosines when transforming
> physical points to indexes and vice versa. It is in working condition.
> The #else's are there to show a more readable version of the code. I
> used template meta-programming to implement the transformations in an
> efficient way. Unfortunately, the meta-programming code is hard to
> follow.
> 
> The ITK_USE_ORIENTED_IMAGE_DIRECTION is newer code to properly handle
> gradient computations when directions are present. I suspect it will
> be defined by default in a future release.
> 
> I recommend using OrientedImage if your images have different directions.
> 
> Admittedly, the code should be documented better. Can you file a bug
> report for that and assign it to me?
> 
> Regards,
> 
> Bill
> 
> On Fri, Jul 25, 2008 at 4:08 PM, Hans Johnson <hans.j.johnson at gmail.com>
> wrote:
>> Bill,
>> 
>> I've been looking at the itkOrientedImge class and would appreciate your
>> input.
>> 
>> 1)  The documentation for this class is very limited, and does not state how
>> an itkOrientedImage is different from an itkImage.  It just states what
>> funding was used to generate this class.
>> 
>> 2) There are several "#if 1/#else/#endif" sections in the code which
>> indicates to me that perhaps this code is still in a debugging state and the
>> behavior may change once the correct behavior is figured out.
>> 
>> 3) #ifdef ITK_USE_ORIENTED_IMAGE_DIRECTION  :  if this is not defined, does
>> the itkOrientedImage behave like the itkImage?
>> 
>> 4) When would you recommend using this class for a registration program
>> intended to public distribution?
>> 
>> ============
>> 
>> On the surface, it seems that it takes care of some issues with registering
>> images that have different image directions to start with.
>> 
>> Thanks,
>> Hans
>> 
>> 
>> 
>> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> http://www.itk.org/mailman/listinfo/insight-developers



More information about the Insight-developers mailing list