[Insight-users] doubt about DeformableRegistration1 and resampling &more

Serena Fabbri fabbri at u.washington.edu
Thu May 21 14:42:51 EDT 2009


Hi Luis,
Tx for your replay.

1)I am using 3.10.0

2) the direction of both images is
1 0 0
0 1 0
0 0 1

3)No. I don't specifying the direction  of the resampling filter

4)I have changed the metric. I am using Mattes Mutal Information.

I guess the problem is a bed alignment between the MRI and CT.
Because if i do Affine Registration and after Deformable Registration I get better results, I mean the image is in the middle of FOV. Can be my guess reasonable?





But now I have another question about ResampleImageFilter.
I want to resample a head CT image.
CT:
size 512 512 49
spacing (0.42 0.42 3)mm
origin (0 0 0)

I want to obtain an 1 mm spacing in z direction.
So the new CT would be:
size 512 512 147
spacing (0.42 0.42 1)mm 
origin (0 0 0)

and I use itkLinearInterpolateImageFunction and itkIdentityTransform

I get an image with the last 2 slices with only the background value (it was set 0).
Is this result correct? why are not there counts in 146 and 147 slides? 
The code is:





         reader->SetFileName( argv[1] );
 	writer->SetFileName( argv[2] );

 	transform->SetIdentity( );
 	resampler->SetTransform( transform );
 	resampler->SetInterpolator( interpolator );
 	resampler->SetDefaultPixelValue( 0 );



 	double spacing[ Dimension ];
 	spacing[0] = 0.42;  // pixel spacing in millimeters along X
 	spacing[1] = 0.42;  // pixel spacing in millimeters along Y
         spacing[2] = 1.;

 	resampler->SetOutputSpacing( spacing );

 	double origin[ Dimension ];
 	origin[0] = 0.;
 	origin[1] = 0.;
 	origin[2] = 0.;

 	resampler->SetOutputOrigin( origin );
 	InputImageType::SizeType   size;

 	size[0] = 512;
 	size[1] = 512;
         size[2] = 147;

 	resampler->SetSize( size );
 	resampler->SetInput( reader->GetOutput() );
 	resampler->Update();



 	writer->SetInput( resampler->GetOutput() );

 	writer->Update();



Tx again.
Serena.







On Wed, 20 May 2009, Luis Ibanez wrote:

>
>
> Hi Serena,
>
>
> 1) What version of ITK are you using ?
>
>
> 2) Please look at the orientation matrix of the images
>   and post it to the list.
>
>   you can get it from
>
>
>   ImageType::DirectionType direction = image->GetDirection()
>
>
> 3) Are you setting the direction of the resampling filter ?
>
>
> 4) Are you using DeformableRegistration1.cxx "AS IT IS IN ITK" ?
>   or have you made any modifications to it ?
>
>
>
>   Regards,
>
>
>       Luis
>
>
> -------------------
> Serena Fabbri wrote:
>> 
>> Hi All,
>> 
>> I have a question.
>> I am registering CT image with MR image of different healthy subjects.
>> I use non rigid registration in particular I run DeformableRegistration1.cxx
>> 
>> 
>> MRI:-> fixed image
>> size 176 256 160
>> spacing (1 1 1)mm
>> origin 0 0 0
>> 
>> CT immage: ->moving image
>> size 512 512 29
>> spacing (0.653595 0.653595 4)mm
>> origin 0 0 0
>> 
>> 
>> The registered image is not in the middle of FOV. It is always shifted in 
>> the down rigth corner.
>> I don't understand if my problem is a very bad choose of parameters (like E, 
>> number of integration points, ecc) or somethings else.
>> My guess is the resample step falls.
>> is it possible? any idea?
>> 
>> any suggestion is very appreciated.
>> 
>> Serena.
>> 
>> 
>> 
>> _____________________________________
>> Powered by www.kitware.com
>> 
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>> 
>> Please keep messages on-topic and check the ITK FAQ at: 
>> http://www.itk.org/Wiki/ITK_FAQ
>> 
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>> 
>




More information about the Insight-users mailing list