<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Thanks a lot, your mail&nbsp;was very useful for me.<BR>
&nbsp;<BR>
Regards,<BR>
Daniela<BR>&nbsp;<BR>
<HR id=stopSpelling>
Date: Sun, 12 Sep 2010 13:10:29 -0400<BR>Subject: Re: [Insight-users] PixelType Doubt<BR>From: luis.ibanez@kitware.com<BR>To: danysunflower@hotmail.it<BR>CC: insight-users@itk.org<BR><BR><BR>Hi Daniela,<BR><BR><BR>In genera you should use:<BR><BR><BR>&nbsp; A) signed short int&nbsp;&nbsp; for &nbsp; &nbsp; CT<BR>&nbsp; B) float&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for&nbsp;&nbsp;&nbsp;&nbsp; PET<BR>&nbsp; C) signed shoft int&nbsp;&nbsp; for&nbsp;&nbsp;&nbsp;&nbsp; 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" target=_blank>http://www.insight-journal.org/browse/publication/146</A><BR><BR><BR><BR>and the code in:<BR><BR>&nbsp;&nbsp; InsightApplications/Auxiliary/vtk<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>&nbsp; imageIO-&gt;SetFileName( this-&gt;FileName.c_str() );<BR>&nbsp; imageIO-&gt;ReadImageInformation();<BR><BR>&nbsp; ScalarPixelType pixelType = imageIO-&gt;GetComponentType();<BR><BR>&nbsp; // Use the pixel type to instantiate the appropriate reader<BR>&nbsp; switch( pixelType )<BR>&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp; case itk::ImageIOBase::UCHAR:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this-&gt;ImageThatHasBeenRead = ReadAndCastMacro( unsigned char ); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this-&gt;ImagePixelType = UNSIGNED_CHAR;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR><BR>...etc.<BR><BR><BR><BR>&nbsp;&nbsp; Regards<BR><BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Luis<BR><BR><BR><BR>---------------------------------------------------<BR>
<DIV class=ecxgmail_quote>On Thu, Sep 9, 2010 at 3:26 AM, Daniela Sacchetto <SPAN dir=ltr>&lt;<A href="mailto:danysunflower@hotmail.it">danysunflower@hotmail.it</A>&gt;</SPAN> wrote:<BR>
<BLOCKQUOTE style="PADDING-LEFT: 1ex" class=ecxgmail_quote>
<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>&nbsp;<BR>For ex I know that:<BR>&nbsp;<BR>PixelType must be "signed" for CT since Hounsfield units can be &lt; 0.<BR>&nbsp;<BR>Are there any rules for each medical image? (TC,PET,US,RX,...)<BR>And when do you use pixelType = unsigned char?<BR>&nbsp;<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>                                               </body>
</html>