I want to create image viewer with itk and vtk.But I have to define image dimension like 2D 3D.I don't want to do it.All I want is that when I read the image from harddisk ,program detect th dimension of image by itself.In other words, my program may read both 2D and 3D images and it gives me what the dimension is. What are your suggestions about it ?
0
votes
What type of image are you using?
- El Marce
Now Dıcom, but I may use all other medical formats such as mha nii etc. in the future
- O.AYYILDIZ
ITK does not give you a one size fits all. You must set manually the dimensions in several image types and then, reading from the dicom header, select proper type. :( is difficult I know.
- El Marce
Someone has already done this before. It is called 3D Slicer.
- siavashk
1 Answers
0
votes
When you read an image in itk, you have to specify with the template the type of pixel and the dimension, example : typedef itk::Image ImageType; You cannot use a fitall dimension or reader. You should declare the image and reader for both 2D and 3D. It is not a "clean" solution but you could do a "try" on both and take the working one.