<div dir="ltr">Hello Mallikarjun,<br><br>If it is a CT scan, maybe you're missing the Rescale Intercept Slope parameters to get the same results as the vtkDicomImageReader ?<br><a href="https://blog.kitware.com/dicom-rescale-intercept-rescale-slope-and-itk/">https://blog.kitware.com/dicom-rescale-intercept-rescale-slope-and-itk/</a><br><br>Simon<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-10 15:12 GMT+01:00 Mallikarjun K <span dir="ltr"><<a href="mailto:mallikarjun49@gmail.com" target="_blank">mallikarjun49@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello Cory,<div><br></div><div>Yes,the first image looks like a human head but it is surrounded by some other gray/balck colored stuff.I think you are right,it is the issue with color/opacity maps.The data is in the range of 0-65536(unsigned short). Below are the color and opacity maps I applied.</div><div><br></div><div><div> //setup opacity</div><div><span style="white-space:pre-wrap"> </span>d->m_opacityTransferFunction->AddPoint(132.108911, 0.000000);</div><div><span style="white-space:pre-wrap"> </span>d->m_opacityTransferFunction->AddPoint(197.063492, 0.041333);</div><div><span style="white-space:pre-wrap"> </span>d->m_opacityTransferFunction->AddPoint(1087.917989, 0.700000);</div><div><span style="white-space:pre-wrap"> </span></div><div><span style="white-space:pre-wrap"> </span>//setup gradient opacity</div><div><span style="white-space:pre-wrap"> </span>d->m_gradientTransferFunction->AddPoint(560.695000, 1.000000);</div><div><br></div><div><span style="white-space:pre-wrap"> </span>// Setup color </div><div><span style="white-space:pre-wrap"> </span>d->m_colorTransferFunction->AddRGBPoint(176.881890, 0.650980, 0.000000, 0.000000);</div><div><span style="white-space:pre-wrap"> </span>d->m_colorTransferFunction->AddRGBPoint(239.427822, 0.933333, 0.000000, 0.000000);</div><div><span style="white-space:pre-wrap"> </span>d->m_colorTransferFunction->AddRGBPoint(301.973753, 1.000000, 0.800000, 0.062745);</div><div><span style="white-space:pre-wrap"> </span>d->m_colorTransferFunction->AddRGBPoint(495.866142, 1.000000, 0.905882, 0.666667);</div><div><span style="white-space:pre-wrap"> </span>d->m_colorTransferFunction->AddRGBPoint(677.249344, 1.000000, 0.882353, 0.215686);</div><div><span style="white-space:pre-wrap"> </span>d->m_colorTransferFunction->AddRGBPoint(808.595801, 1.000000, 1.000000, 1.000000);</div></div><div><br></div><div>What should I do to eliminate gray/balck colored stuff ? please guide me.</div><div><br></div><div>Thank you.</div><div>Regards,</div><div>Mallikarjun</div><div><br></div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 10, 2016 at 7:18 PM, Cory Quammen <span dir="ltr"><<a href="mailto:cory.quammen@kitware.com" target="_blank">cory.quammen@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Mallikarjun,<div><br></div><div>Could you clarify for me whether the first image at all looks like a human head? Is the issue that the color/opacity maps do not appear to be applied correctly, or that the data is just completely strange when reading from dcmtk?</div><div><br></div><div>If it is the latter, I have a couple guesses:</div><div><br></div><div>- maybe your dimensions are off from what dcmtk tells you</div><div>- maybe dcmtk's conventions for voxel order are different from VTK<span><font color="#888888"><br></font></span></div><span><font color="#888888"><div><br></div><div>Cory</div></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 10, 2016 at 2:40 AM, Mallikarjun K <span dir="ltr"><<a href="mailto:mallikarjun49@gmail.com" target="_blank">mallikarjun49@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello Cory Quammen,<div><br></div><div>Thanks for the response and suggestions.We are kind of established in using dcmtk in our project,So couldn't use vtk-dicom for time being.</div><div><br></div><div>Below is the code snippet which I used to get dcmtk data to vtk:</div><div><br></div><div><br></div><div>vtkDataArray* scalars = 0;<br></div><div><br></div><div><br></div><div><br></div><div><div>switch (dicomDataType)</div><div><span style="white-space:pre-wrap"> </span>{</div><div><span style="white-space:pre-wrap"> </span>case TYPE_U32Data:</div><div><span style="white-space:pre-wrap"> </span>scalars = vtkUnsignedIntArray::New();</div><div><span style="white-space:pre-wrap"> </span>((vtkUnsignedIntArray*)(scalars))->SetArray((unsigned int*)dicomData, dicomDataSize, 1);//dicomData is the data from dcmtk</div><div><span style="white-space:pre-wrap"> </span>break;</div><div><span style="white-space:pre-wrap"> </span>case TYPE_U8Data:</div><div><span style="white-space:pre-wrap"> </span>scalars = vtkUnsignedCharArray::New();</div><div><span style="white-space:pre-wrap"> </span>((vtkUnsignedCharArray*)(scalars))->SetArray((unsigned char*)dicomData, dicomDataSize, 1);</div><div><span style="white-space:pre-wrap"> </span>break;</div><div><span style="white-space:pre-wrap"> </span>case TYPE_U16Data:</div><div><span style="white-space:pre-wrap"> </span>scalars = vtkUnsignedShortArray::New();</div><div><span style="white-space:pre-wrap"> </span>((vtkUnsignedShortArray*)(scalars))->SetArray((unsigned short*)dicomData, dicomDataSize, 1);</div><div><span style="white-space:pre-wrap"> </span>break;</div><div><span style="white-space:pre-wrap"> </span>case TYPE_S16Data:</div><div><span style="white-space:pre-wrap"> </span>scalars = vtkShortArray::New();</div><div><span style="white-space:pre-wrap"> </span>((vtkShortArray*)(scalars))->SetArray((short*)dicomData, dicomDataSize, 1);</div><div><span style="white-space:pre-wrap"> </span>break;</div><div><span style="white-space:pre-wrap"> </span>}</div><div><span style="white-space:pre-wrap"> </span>scalars->SetNumberOfComponents(1);</div><div><span style="white-space:pre-wrap"> </span>double range[2];</div><div><span style="white-space:pre-wrap"> </span>scalars->GetRange(range);</div><div><span style="white-space:pre-wrap"> </span>m_imageData = vtkImageData::New();</div><div><span style="white-space:pre-wrap"> </span>m_imageData->SetDimensions(dimensions);</div><div><span style="white-space:pre-wrap"> </span>m_imageData->SetSpacing(spacing);</div><div><span style="white-space:pre-wrap"> </span>m_imageData->GetPointData()->SetScalars(scalars);</div><div><span style="white-space:pre-wrap"> </span>scalars->Delete();</div><div><span style="white-space:pre-wrap"> </span>m_imageData->GetPointData()->GetScalars()->SetName("VR Cuboid");</div></div><div><br></div><div><br></div><div>Thanks&Regards,</div><div>Mallikarjun</div><div><br></div><div><br></div></div><div class="gmail_extra"><div><div><br><div class="gmail_quote">On Tue, Feb 9, 2016 at 8:47 PM, Cory Quammen <span dir="ltr"><<a href="mailto:cory.quammen@kitware.com" target="_blank">cory.quammen@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">How are you getting the data from dcmtk to VTK? Code would be helpful.<div><br></div><div>As an aside, you may be interested in David Gobbi's excellent DICOM reader for VTK.</div><div><br></div><div><a href="https://github.com/dgobbi/vtk-dicom" target="_blank">https://github.com/dgobbi/vtk-dicom</a><br></div><div><br></div><div>I believe you can build this within VTK by enabling the Module_vtkDICOM option.</div><div><br></div><div>Best,</div><div>Cory</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Tue, Feb 9, 2016 at 8:25 AM, Mallikarjun K <span dir="ltr"><<a href="mailto:mallikarjun49@gmail.com" target="_blank">mallikarjun49@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><div>Hello All,</div><div>I used dcmtk to read dicom raw data and applied Modality LUT and created a vtkImageData. When I used this data for Volume Rendering(vtkGPUVolumeRayCastMapper), I am getting the following output.</div><div> <br></div><div><br></div><div><img src="cid:ii_152c619481cb9c6c" alt="Inline image 2" width="219" height="223" style="margin-right:0px"><br></div><div><br></div><div><br></div><div>When I used vtkDicomImageReader's output for Volume rendering ,I am getting the following output.</div><div><br></div><img src="cid:ii_152c618cc6879746" alt="Inline image 1" width="222" height="179"><div><br></div><div>Can anyone give some pointers why this is happening?<br clear="all"><div><br></div><div>Thanks in advance..</div><span><font color="#888888">-- <br><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><b style="font-family:tahoma,sans-serif">With Kind Regards:</b><br style="font-family:tahoma,sans-serif"><span style="font-family:tahoma,sans-serif">Mallikarjun</span></div><div dir="ltr"><font face="tahoma, sans-serif"><br></font><span style="font-family:tahoma,sans-serif"></span><div><br></div></div></div></div></div></div></div>
</font></span></div></div>
<br></div></div>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span><font color="#888888">-- <br><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><b style="font-family:tahoma,sans-serif">With Kind Regards:</b><br style="font-family:tahoma,sans-serif"><span style="font-family:tahoma,sans-serif">Mallikarjuna K,</span></div><div dir="ltr"><font face="tahoma, sans-serif"><a href="tel:07795531103" value="+917795531103" target="_blank">07795531103</a>/<a href="tel:09908238861" value="+919908238861" target="_blank">09908238861</a>.<br></font><span style="font-family:tahoma,sans-serif"></span><div><br></div></div></div></div></div></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><b style="font-family:tahoma,sans-serif">With Kind Regards:</b><br style="font-family:tahoma,sans-serif"><span style="font-family:tahoma,sans-serif">Mallikarjuna K,</span></div><div dir="ltr"><font face="tahoma, sans-serif">07795531103/09908238861.<br></font><span style="font-family:tahoma,sans-serif"></span><div><br></div></div></div></div></div></div></div>
</div>
</div></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>------------------------------------------------------------------<br>Simon Esneault<div>Rennes, France<br>------------------------------------------------------------------</div></div></div></div>
</div>