<div dir="ltr"><div>Hi Alex,</div><div><br></div><div>You can also try the vtkDICOMReader that comes with vtk-dicom. It provides easy access to all of the meta-data, rather than just the limited amount of information in the MedicalImageProperties object.</div><div><br></div><div><a href="http://dgobbi.github.io/vtk-dicom/doc/api/pages.html">http://dgobbi.github.io/vtk-dicom/doc/api/pages.html</a><br></div><div><br></div><div>Cheers,</div><div> - David</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 11, 2017 at 11:04 PM, Alex Liu via vtkusers <span dir="ltr"><<a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">For those who are struggling with this I found a solution.<br>
first vtkDICOMImageReader doesn't support getting DICOM image properties for<br>
now(tested in vtk v7).<br>
To read DICOM image properties you need to download GDCM can be downloaded<br>
from here <<a href="https://sourceforge.net/projects/gdcm/" rel="noreferrer" target="_blank">https://sourceforge.net/<wbr>projects/gdcm/</a>><br>
<br>
after download and extracting GDCM you need to open CMake<br>
in CMake Check those attributes<br>
1-GDCM_USE_VTK and select VTK_DIR and vtk directory<br>
2-GDCM_BUILD_SHARED_LIBS<br>
3-GDCM_BUILD_APPLICATIONS<br>
now click configure and generate. Use your compiler to build it.<br>
<br>
In my case I got error while building GDCM that it could not find vtk lib<br>
files. which I already had in the folder. So I had to edit<br>
gdcm-2.6.6/build/cmake_<wbr>install.cmake file under INSTALL DESTINATION I had to<br>
add lib in front of vtkCommonCore-7.0.dll and the rest of the files, since<br>
in my vtk bin folder all my files had lib prefix.<br>
<br>
once GDCM is ready now you need to configure vtk<br>
open vtk in CMake and set and check those attributes<br>
1-GDCM_DIR select the build directory of GDCM<br>
2-USE_GDCM<br>
now configure and generate.<br>
now you are ready to build vtk.<br>
<br>
next thing you need to do is set environment variable for gdcm and import<br>
lib to your project.<br>
now you are ready to use GDCM<br>
<br>
To get DICOM image properties you need to do the following<br>
<br>
vtkSmartPointer<<wbr>vtkGDCMImageReader> reader =<br>
vtkSmartPointer<<wbr>vtkGDCMImageReader>::New();<br>
reader->SetFileName(filename.<wbr>c_str());<br>
reader->Update();<br>
reader-><wbr>GetMedicalImageProperties()-><wbr>GetPatientName(); // to get Patient<br>
Name as an example<br>
<br>
double w,l;<br>
reader-><wbr>GetMedicalImageProperties()-><wbr>GetNthWindowLevelPreset(0, &w, &l); //<br>
get window width and window level.<br>
<br>
Hope this helps.<br>
<br>
for any question you can send me an email at <a href="mailto:tehsunnliu@yahoo.com">tehsunnliu@yahoo.com</a><br>
</blockquote></div><br></div></div>