[Insight-users] Small Doubt about casting

Luis Ibanez luis.ibanez at kitware.com
Wed Apr 11 12:47:33 EDT 2007


Hi Raja,

The input that you are passing is it just an "int" type ?
or are you talking about "an image of pixel type int" ?

If it is just a type "int", then automatic casting may do
the trick for you. If you are dealing with an image then
you should read the ITK Software Guide:

     http://www.itk.org/ItkSoftwareGuide.pdf

in particular the sections related to the filters:

   * CastImageFilter
   * RescaleIntensityImageFilter
   * IntensityWindowingImageFilter


In general, you shouldn't leave casting to the compiler,
you should use explicit casting with:


     static_cast< OutputType >( inputVariable );


Regards,


    Luis


------------------------------
Raja Yalamanchili wrote:
> Hi,
> I just got a doubt while using itk filters, if i'm giving input as 
> integer type and set output as character type will the filters 
> automatically cast Int to char 'or' we have to pass it through a cast 
> filter to get desired character output.
> 
> Thanks,
> Raja Yalamanchili.(UH)
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list