[Insight-developers] image data type

Karthik Krishnan karthik.krishnan at kitware.com
Tue Mar 13 14:44:26 EST 2007


On 3/13/07, Leila Baghdadi <baghdadi at sickkids.ca> wrote:
>
> so far whenever I read an image, I made sure I knew the data type of the
> image in advance and used itkImage with the correct data type.
>
> so the question is if I did not want to bother with checking image data
> type in advance and just want to read the image, is there a way to make
> the code deal with data type.



The solution, as Bill mentioned is to instantiate your application over
every possible native datatype and choose at runtime, which instantiation to
use. We do this in our applications here . As an example, see VolViewPlugins
in InsightApplication (
http://www.itk.org/cgi-bin/viewcvs.cgi/VolviewPlugIns/vvITKMask.cxx?rev=1.2&root=InsightApplications&view=log)
As Bill mentioned, you can get the type you wish to use at runtime after
ReadImageInformation and then instantiate the readers..

Doing so does increase your compile time 10 fold, cause you're compiling
every parametrization of the template now :-(.....

--
karthik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.itk.org/mailman/private/insight-developers/attachments/20070313/2f7b9bc7/attachment.html


More information about the Insight-developers mailing list