<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 class="" style="white-space:pre"> </span>{</div><div><span class="" style="white-space:pre"> </span>case TYPE_U32Data:</div><div><span class="" style="white-space:pre"> </span>scalars = vtkUnsignedIntArray::New();</div><div><span class="" style="white-space:pre"> </span>((vtkUnsignedIntArray*)(scalars))->SetArray((unsigned int*)dicomData, dicomDataSize, 1);//dicomData is the data from dcmtk</div><div><span class="" style="white-space:pre"> </span>break;</div><div><span class="" style="white-space:pre"> </span>case TYPE_U8Data:</div><div><span class="" style="white-space:pre"> </span>scalars = vtkUnsignedCharArray::New();</div><div><span class="" style="white-space:pre"> </span>((vtkUnsignedCharArray*)(scalars))->SetArray((unsigned char*)dicomData, dicomDataSize, 1);</div><div><span class="" style="white-space:pre"> </span>break;</div><div><span class="" style="white-space:pre"> </span>case TYPE_U16Data:</div><div><span class="" style="white-space:pre"> </span>scalars = vtkUnsignedShortArray::New();</div><div><span class="" style="white-space:pre"> </span>((vtkUnsignedShortArray*)(scalars))->SetArray((unsigned short*)dicomData, dicomDataSize, 1);</div><div><span class="" style="white-space:pre"> </span>break;</div><div><span class="" style="white-space:pre"> </span>case TYPE_S16Data:</div><div><span class="" style="white-space:pre"> </span>scalars = vtkShortArray::New();</div><div><span class="" style="white-space:pre"> </span>((vtkShortArray*)(scalars))->SetArray((short*)dicomData, dicomDataSize, 1);</div><div><span class="" style="white-space:pre"> </span>break;</div><div><span class="" style="white-space:pre"> </span>}</div><div><span class="" style="white-space:pre"> </span>scalars->SetNumberOfComponents(1);</div><div><span class="" style="white-space:pre"> </span>double range[2];</div><div><span class="" style="white-space:pre"> </span>scalars->GetRange(range);</div><div><span class="" style="white-space:pre"> </span>m_imageData = vtkImageData::New();</div><div><span class="" style="white-space:pre"> </span>m_imageData->SetDimensions(dimensions);</div><div><span class="" style="white-space:pre"> </span>m_imageData->SetSpacing(spacing);</div><div><span class="" style="white-space:pre"> </span>m_imageData->GetPointData()->SetScalars(scalars);</div><div><span class="" style="white-space:pre"> </span>scalars->Delete();</div><div><span class="" style="white-space:pre"> </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"><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 class="h5">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 class="h5"><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 class="HOEnZb"><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>-- <br><div class="gmail_signature"><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>