[Insight-users] DeformableRegsitration1

Jayme Kosior jckosior at ucalgary.ca
Thu Jun 3 12:40:02 EDT 2004


Hi Josiane,

If you just want the output of DeformableRegistration1 to be of type 
unsigned short (or any other type for that matter), then you could just 
add the following lines:

   typedef itk::Image<unsigned short, 2>                            
Image2DType;
   itk::ImageFileWriter<Image2DType>::Pointer warpWriter;
   warpWriter =  itk::ImageFileWriter<Image2DType>::New();
   warpWriter->SetFileName((X->GetResultsFileName()).c_str());
   std::cout << "Writing to file: " << X->GetResultsFileName().c_str() 
<< std::endl;
   warpWriter->SetInput(X->GetWarpedImage() );
   warpWriter->Write();

This way you don't have to modify the actual filter.  In your case, you 
will need to setup the FEMRegistrationFilter to have unsigned short 
input/output images.

The key idea is that you can obtain the output using 
FEMRegistrationFilterObject->GetWarpedImage() and set this to the input 
of the writer..

Regards,

Jayme Kosior


On Jun 03, 2004, at 01:09, Luis Ibanez wrote:

> Hi Josiane,
>
> When you change the type "fileImageType" in this example,
> you are only changing the way the images are read, not
> how the results are saved.
>
> You don't really need to change the output type of the
> RescaleIntensityFilter, but rather add a new Rescale
> Intensity filter at the output of the registration
> method.
>
>
> A quick solution for you is to go to the file
>
>
>   Insight/Code/Algorithms/itkFEMRegistrationFilter.txx
>
>
> and modify the lines: 1659-1706 on the method
> WriteWrappedImage.
>
> There you could change the output image type of the
> ShiftScaleImageFilter. (line 1684) and put an output
> type "unsigned short". Note also that you may want
> to change the values you want to get for the minimum
> and maximum of the output image.
>
> In practice,...
> we need to refactor the FEMRegistration filter because
> it is doing too much for a filter. ... it is almost
> an applications.
>
>
> Please let us know if you run into any problems,
>
>
>
>    Thanks,
>
>
>
>       Luis
>
>
>
> --------------------------------------------------
> Josiane Yankam Njiwa--DEA Clarysse--Fin 11/04 wrote:
>
>> Hi,
>> I use the DeformableRegsitration1.cxx with images witch are short one.
>> My problem is that i would like to have as output an image which type 
>> is
>> short. I make changes on the image type(typedefitk::Image<short ,2>
>> fileImageType;), but nothing change.
>> I would like to know if the output of RescaleIntensityImageFilter can 
>> just
>> be an image with uchar type.
>> Thanks for your help.
>> Regards
>> Josiane.
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 3154 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20040603/baf89c5e/attachment.bin


More information about the Insight-users mailing list