<div dir="ltr"><div class="gmail_extra"><p style="margin:0px;font-size:13px;line-height:normal;font-family:verdana;color:rgb(35,35,35)"><span style="-webkit-font-kerning: none;">Hi Dženan,</span></p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:verdana;color:rgb(35,35,35);min-height:16px"><span style="-webkit-font-kerning: none;"></span><br></p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:verdana;color:rgb(35,35,35)">Yes, that makes sense.  Thanks very much for your help.<br></p><div>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:verdana;color:rgb(35,35,35);min-height:16px"><br><span style="-webkit-font-kerning: none;"></span></p>
<p style="margin:0px;font-size:13px;line-height:normal;font-family:verdana;color:rgb(35,35,35)"><span style="-webkit-font-kerning: none;">- Tammy</span></p></div><div><div class="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div></div></div></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On 5 September 2016 at 15:07, Dženan Zukić wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div style="font-family:verdana,sans-serif;font-size:small">Hi Tammy,</div><div style="font-family:verdana,sans-serif;font-size:small"><br></div><div style="font-family:verdana,sans-serif;font-size:small">the <a href="http://docs.opencv.org/2.4/modules/core/doc/basic_structures.html" target="_blank">docs</a> list unsigned short and int, but not unsigned int. I don't know whether this int is equal to short or long. But from \ITK-git\Modules\Video\<wbr>BridgeOpenCV\include\<wbr>itkOpenCVImageBridge.hxx, line 50 these are supported cases:</div><div style="font-family:verdana,sans-serif;font-size:small"><div>IPL_DEPTH_8U</div><div>IPL_DEPTH_8S</div><div>IPL_DEPTH_16U</div><div>IPL_DEPTH_16S</div><div>IPL_DEPTH_32F</div><div>IPL_DEPTH_64F</div><div><br></div><div>To convert to 16U (which is closest to your 32U), you should use <a href="https://itk.org/Doxygen/html/classitk_1_1CastImageFilter.html" target="_blank">cast filter</a> (that's your option A).</div><div><br></div><div>Regards,</div><div>Dženan</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 5, 2016 at 1:31 PM, Tammy wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div style="margin:0in 0in 0.0001pt">Greetings!  Hope everyone is having a good day...</div><div style="margin:0in 0in 0.0001pt"><br></div><div style="margin:0in 0in 0.0001pt">So... we are passing around a grayscale image... and we're using unsigned int (as opposed to unsigned char):</div><div style="margin:0in 0in 0.0001pt"><div style="margin:0in 0in 0.0001pt"><font face="monospace, monospace">typedef itk::Image<unsigned int, ImageDimension> itkUIntImageType;</font></div><div style="margin:0in 0in 0.0001pt"><font face="monospace, monospace">typedef itkUIntImageType itkLabelImageType;
</font></div></div><div style="margin:0in 0in 0.0001pt"><br></div><div style="margin:0in 0in 0.0001pt">I need to convert it to cv::Mat in order to pass it to another program:</div><div style="margin:0in 0in 0.0001pt"><font face="monospace, monospace">cv::Mat resultImage = itk::OpenCVImageBridge::ITKIma<wbr>geToCVMat< itkLabelImageType >( m_objectLabelImage );<br></font></div><div style="margin:0in 0in 0.0001pt"><br></div><div style="margin:0in 0in 0.0001pt">The problem is, the compiler is telling me "OpenCV does not support the input pixel type".</div><div style="margin:0in 0in 0.0001pt"><br></div><div style="margin:0in 0in 0.0001pt">So my question is -- is this true?  Can I only convert from unsigned char?</div><div style="margin:0in 0in 0.0001pt">Would a good solution be to:</div><div style="margin:0in 0in 0.0001pt">A) Convert from one pixel type to another, or</div><div style="margin:0in 0in 0.0001pt">B) Or can I just read in the <span style="font-family:monospace,monospace">m_objectLabelImage</span> to an Image::Pointer thing that is of type unsigned char?</div><div style="margin:0in 0in 0.0001pt"><br></div><div style="margin:0in 0in 0.0001pt">Thanks!</div><div style="margin:0in 0in 0.0001pt"><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></blockquote></div></div></blockquote></div></div></div>