<br>Hi Daniela,<br><br><br>In genera you should use:<br><br><br> A) signed short int for CT<br> B) float for PET<br> C) signed shoft int for MRI<br><br>I'm not sure about US, but I would expect<br>
that "unsigned char" will be a good fit.<br><br><br><br>Please take a look at the Insight Journal paper:<br><br><a href="http://www.insight-journal.org/browse/publication/146">http://www.insight-journal.org/browse/publication/146</a><br>
<br><br><br>and the code in:<br><br> InsightApplications/Auxiliary/vtk<br> vtkKWImageIO.cxx<br><br><br><br>You will see how you can query the actual<br>pixel type of a DICOM file, and then instantiate<br>
the appropriate pixel type for it.<br><br>Look at the "ReadAndCast()" method in lines 465-558:<br><br><br><br> imageIO->SetFileName( this->FileName.c_str() );<br> imageIO->ReadImageInformation();<br><br>
ScalarPixelType pixelType = imageIO->GetComponentType();<br><br> // Use the pixel type to instantiate the appropriate reader<br> switch( pixelType )<br> {<br> case itk::ImageIOBase::UCHAR:<br> {<br> this->ImageThatHasBeenRead = ReadAndCastMacro( unsigned char ); <br>
this->ImagePixelType = UNSIGNED_CHAR;<br> break;<br> }<br><br>...etc.<br><br><br><br> Regards<br><br><br> Luis<br><br><br><br>---------------------------------------------------<br><div class="gmail_quote">
On Thu, Sep 9, 2010 at 3:26 AM, Daniela Sacchetto <span dir="ltr"><<a href="mailto:danysunflower@hotmail.it">danysunflower@hotmail.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>
Hi everyone,<br>
I'm writing because I have a question for you.<br>
Could anyone explain me how can I decide the itk::PixelType? Usually I work with unsigned short pixels, but now I would like to understand better this problem.<br>
<br>
For ex I know that:<br>
<br>
PixelType must be "signed" for CT since Hounsfield units can be < 0.<br>
<br>
Are there any rules for each medical image? (TC,PET,US,RX,...)<br>
And when do you use pixelType = unsigned char?<br>
<br>
Thanks all for your help,<br>
Regards<br>
Daniela<br>                                            </div>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>