Great! I successfully built it after applying the patch.<div><br></div><div>Thanks,</div><div><br></div><div>Roger<br><div><br><div class="gmail_quote">On Thu, Jul 29, 2010 at 10:37 AM, Mathieu Malaterre <span dir="ltr"><<a href="mailto:mathieu.malaterre@gmail.com">mathieu.malaterre@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">[top post]<br>
<br>
This has been fixed in ITK CVS HEAD/ git master:<br>
<br>
<a href="http://itk.org/gitweb?p=ITK.git;a=commitdiff;h=93833edb2294c0190af9e6c0de26e9485399a7d3" target="_blank">http://itk.org/gitweb?p=ITK.git;a=commitdiff;h=93833edb2294c0190af9e6c0de26e9485399a7d3</a><br>
<br>
Simply apply that to your ITK version XX<br>
<br>
HTH<br>
<div><div></div><div class="h5"><br>
On Thu, Jul 29, 2010 at 10:29 AM, Roger Bramon Feixas<br>
<<a href="mailto:rogerbramon@gmail.com">rogerbramon@gmail.com</a>> wrote:<br>
> Hi,<br>
> I'm working with Jesús and we found the problem: we upgraded from GDCM<br>
> 2.0.14 to 2.0.15 but ITK 3.18 wasn't been rebuilt. However, we need to build<br>
> GDCM 2.0.15 with VTK support but then it isn't possible to build ITK using<br>
> external GDCM 2.0.15+VTK as we're discussing<br>
> here: <a href="http://www.itk.org/pipermail/insight-users/2010-July/037515.html" target="_blank">http://www.itk.org/pipermail/insight-users/2010-July/037515.html</a>.<br>
> Have you found a solution to be able to compile ITK?<br>
> Thanks!<br>
> Roger<br>
> On Tue, Jul 27, 2010 at 1:34 PM, Mathieu Malaterre<br>
> <<a href="mailto:mathieu.malaterre@gmail.com">mathieu.malaterre@gmail.com</a>> wrote:<br>
>><br>
>> You said you were using ITK+GDCM2. If this is the case then this is<br>
>> already integrated for you.<br>
>><br>
>> BTW, this does not impact CT, so there is something else going on, on<br>
>> your setup.<br>
>><br>
>> HTH<br>
>><br>
>> On Tue, Jul 27, 2010 at 1:13 PM, Jesús Spínola <<a href="mailto:jspinola@gmail.com">jspinola@gmail.com</a>><br>
>> wrote:<br>
>> > Hi Mathieu,<br>
>> > I get the same result as you running "gdcmviewer". The issue is<br>
>> > occurring<br>
>> > under windows, I haven't tested under any other operating system.<br>
>> > How can I achieve the "--force-rescale" behaviour with my sample<br>
>> > program?<br>
>> > I'll take a look to the gdcmviewer app too.<br>
>> ><br>
>> > On Fri, Jul 23, 2010 at 7:17 PM, Mathieu Malaterre<br>
>> > <<a href="mailto:mathieu.malaterre@gmail.com">mathieu.malaterre@gmail.com</a>> wrote:<br>
>> >><br>
>> >> Jesús,<br>
>> >><br>
>> >> First thing first what do you get when you run:<br>
>> >><br>
>> >> $ gdcmviewer --force-rescale -V 05119865-mr-siemens-avanto-syngo.dcm<br>
>> >><br>
>> >> I am getting:<br>
>> >><br>
>> >> ...<br>
>> >> Increments: (0, 0, 0)<br>
>> >> Extent: (0, 447, 0, 335, 0, 0)<br>
>> >><br>
>> >> Range: -1186 526<br>
>> >><br>
>> >> Which seems about right, according to your number.<br>
>> >><br>
>> >> Thanks !<br>
>> >><br>
>> >><br>
>> >> On Fri, Jul 23, 2010 at 10:56 AM, Jesús Spínola <<a href="mailto:jspinola@gmail.com">jspinola@gmail.com</a>><br>
>> >> wrote:<br>
>> >> > Hi,<br>
>> >> > So far I was using gdcm 2.0.14 and I was able to read any image with<br>
>> >> > no<br>
>> >> > problem, but I upgraded recently to gdcm 2.0.15 and I found a problem<br>
>> >> > reading some CT and MR DICOM image files.<br>
>> >> > The way I'm reading DICOM files is using itkGDCMImageIO with<br>
>> >> > itkImageSeriesReader and then filtering the output to vtk for the<br>
>> >> > image<br>
>> >> > rendering.<br>
>> >> > The problem is that some images are now (gdcm 2.0.15) loaded with a<br>
>> >> > different scalar range than before (gdcm 2.0.14), hence they are not<br>
>> >> > displayed properly with the default window/level setting (almost<br>
>> >> > completely<br>
>> >> > white in most CT cases for instance). I observed that the images with<br>
>> >> > trouble were those containing rescale intercept/slope tags with some<br>
>> >> > value.<br>
>> >> > The images with no rescale intercept/slope present are displayed as<br>
>> >> > expected, so my guess is there is some problem regarding the<br>
>> >> > intercept/slope<br>
>> >> > rescale computation.<br>
>> >> > I've written a little program which reads a DICOM image and renders<br>
>> >> > it<br>
>> >> > with<br>
>> >> > vtk to reproduce the bug. Then I compiled it against gdcm 2.0.14 and<br>
>> >> > 2.0.15<br>
>> >> > to see the differences between each other. The source code is at the<br>
>> >> > end<br>
>> >> > of<br>
>> >> > this e-mail.<br>
>> >> > I've been testing with some DICOM images<br>
>> >> ><br>
>> >> > from <a href="http://www.creatis.insa-lyon.fr/~jpr/PUBLIC/gdcm/gdcmData.tar.gz" target="_blank">http://www.creatis.insa-lyon.fr/~jpr/PUBLIC/gdcm/gdcmData.tar.gz</a>.<br>
>> >> > Some<br>
>> >> > of these test images are valid to reproduce the problem, in this case<br>
>> >> > I'll<br>
>> >> > show you the results with<br>
>> >> > MR-MONO2-12-shoulder.dcm, CT-SIEMENS-Icone-With-PaletteColor.dcm<br>
>> >> > and 05119865-mr-siemens-avanto-syngo.dcm.<br>
>> >> > In the following table I show some of the relevant information of<br>
>> >> > each<br>
>> >> > image<br>
>> >> > and the scalar range I get building the program against gdcm 2.0.14<br>
>> >> > and<br>
>> >> > 2.0.15. The right scalar range is the one obtained with gdcm 2.0.14.<br>
>> >> > The<br>
>> >> > result is specially bad with the MR-MONO2-12-shoulder.dcm image.<br>
>> >> > File WW,WL Bits Allocated/Stored Rescale Slope/Intercept Scalar<br>
>> >> > Range:<br>
>> >> > 2.0.14 Build 2.0.15 Build<br>
>> >> > MR-MONO2-12-shoulder.dcm 2000,1000 16/12 3.774114, 0.000061 0..2245<br>
>> >> > -32065..32556<br>
>> >> > CT-SIEMENS-Icone-With-PaletteColor.dcm 350,40 16/12 1, -1024<br>
>> >> > -1024..981<br>
>> >> > 0..2005<br>
>> >> > 05119865-mr-siemens-avanto-syngo.dcm 1538,98 16/12 2, -4096<br>
>> >> > -1186..526<br>
>> >> > 1455..2311<br>
>> >> ><br>
>> >> > I tested with itk 3.18 and vtk 5.6, (the vtk version might not make<br>
>> >> > any<br>
>> >> > sense in the results because the problem is just in the reading<br>
>> >> > stage).<br>
>> >> > (Look at some screenshots of the results)<br>
>> >> > //<br>
>> >> > // SOURCE CODE<br>
>> >> > //<br>
>> >> > //<br>
>> >> > // You'll need also itkImageToVTKImageFilter class, available in the<br>
>> >> > InsightApplications package under "Auxiliary\vtk" folder<br>
>> >> > //<br>
>> >> > // Usage: main.exe DICOMFilename [WindowWidth WindowLevel]<br>
>> >> > #include <vtkImageviewer2.h><br>
>> >> > #include <vtkRenderWindowInteractor.h><br>
>> >> > #include <vtkRenderWindow.h><br>
>> >> > #include <itkImage.h><br>
>> >> > #include <itkImageSeriesReader.h><br>
>> >> > #include <itkGDCMImageIO.h><br>
>> >> > #include "itkImageToVTKImageFilter.h" //Converts an ITK image into a<br>
>> >> > VTK<br>
>> >> > image and plugs a itk data pipeline to a VTK datapipeline.<br>
>> >> > int main(int argc, char* argv[])<br>
>> >> > {<br>
>> >> > // Voxel type and image dimension<br>
>> >> > typedef signed short int VoxelType;<br>
>> >> > typedef VoxelType ItkPixelType;<br>
>> >> > static const unsigned int VDimension = 3;<br>
>> >> > // Itk Image type<br>
>> >> > typedef itk::Image<ItkPixelType, VDimension> ItkImageType;<br>
>> >> > typedef ItkImageType::Pointer ItkImageTypePointer;<br>
>> >> ><br>
>> >> > // Series reader<br>
>> >> > typedef itk::ImageSeriesReader<ItkImageType> SeriesReaderType;<br>
>> >> > typedef itk::GDCMImageIO ImageIOType;<br>
>> >> > // itk2vtk filter<br>
>> >> > typedef itk::ImageToVTKImageFilter<ItkImageType><br>
>> >> > ItkToVtkFilterType;<br>
>> >> > /// DICOM Reader<br>
>> >> > SeriesReaderType::Pointer m_seriesReader =<br>
>> >> > SeriesReaderType::New();<br>
>> >> > ImageIOType::Pointer m_gdcmIO = ImageIOType::New();<br>
>> >> ><br>
>> >> > m_seriesReader->SetImageIO(m_gdcmIO);<br>
>> >> > ItkToVtkFilterType::Pointer m_itkToVtkFilter =<br>
>> >> > ItkToVtkFilterType::New();<br>
>> >> > // Check the number of parameters given<br>
>> >> > if (argc >= 2)<br>
>> >> > {<br>
>> >> > // Create the renderer object and configure it<br>
>> >> > vtkImageViewer2 *viewer = vtkImageViewer2::New();<br>
>> >> > vtkRenderWindowInteractor *interactor =<br>
>> >> > vtkRenderWindowInteractor::New();<br>
>> >> > viewer->SetupInteractor(interactor);<br>
>> >> > // Set the first argument as the input filename to read<br>
>> >> > // Atention: We don't check whether the file is valid or not<br>
>> >> > m_seriesReader->SetFileName(argv[1]);<br>
>> >> > m_itkToVtkFilter->SetInput(m_seriesReader->GetOutput());<br>
>> >> > try<br>
>> >> > {<br>
>> >> > m_itkToVtkFilter->Update();<br>
>> >> > }<br>
>> >> > catch (itk::ExceptionObject & exception)<br>
>> >> > {<br>
>> >> > std::cerr << "Exception caught!" <<<br>
>> >> > exception.GetDescription()<br>
>> >> > << std::endl;<br>
>> >> > }<br>
>> >> > // Show some information about the image<br>
>> >> > m_itkToVtkFilter->GetOutput()->Print(std::cout);<br>
>> >> > std::cerr << "** Scalar Range **" << std::endl;<br>
>> >> > std::cerr <<<br>
>> >> > m_itkToVtkFilter->GetOutput()->GetScalarRange()[0]<br>
>> >> > <<<br>
>> >> > ".." << m_itkToVtkFilter->GetOutput()->GetScalarRange()[1] <<<br>
>> >> > std::endl;<br>
>> >> > // Set the viewer input (DICOM File) and do the rendering<br>
>> >> > stuff<br>
>> >> > viewer->SetInput(m_itkToVtkFilter->GetOutput());<br>
>> >> ><br>
>> >> > // We can optionally set the window/level through the<br>
>> >> > arguments<br>
>> >> > if (argc >=4)<br>
>> >> > {<br>
>> >> > std::cout << "Applying given ww/wl: " << argv[2] << ", "<br>
>> >> > <<<br>
>> >> > argv[3] << std::endl;<br>
>> >> > viewer->SetColorWindow(atof(argv[2]));<br>
>> >> > viewer->SetColorLevel(atof(argv[3]));<br>
>> >> > }<br>
>> >> > else<br>
>> >> > {<br>
>> >> > std::cout << "Applying default ww/wl: 256, 128" <<<br>
>> >> > std::endl;<br>
>> >> > viewer->SetColorWindow(256);<br>
>> >> > viewer->SetColorLevel(128);<br>
>> >> > }<br>
>> >> ><br>
>> >> > viewer->Render();<br>
>> >> > interactor->Start();<br>
>> >> > }<br>
>> >> > else<br>
>> >> > {<br>
>> >> > std::cerr << "Usage: main.exe DICOMFilename [WindowWidth<br>
>> >> > WindowLevel]" << std::endl;<br>
>> >> > }<br>
>> >> > return 0;<br>
>> >> > }<br>
>> >> > --<br>
>> >> > Jesús Spínola<br>
>> >> ><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>
>> >> ><br>
>> >><br>
>> >><br>
>> >><br>
>> >> --<br>
>> >> Mathieu<br>
>> ><br>
>> ><br>
>> ><br>
>> > --<br>
>> > Jesús Spínola<br>
>> ><br>
>><br>
>><br>
>><br>
>> --<br>
>> Mathieu<br>
>><br>
>><br>
>> ------------------------------------------------------------------------------<br>
>> The Palm PDK Hot Apps Program offers developers who use the<br>
>> Plug-In Development Kit to bring their C/C++ apps to Palm for a share<br>
>> of $1 Million in cash or HP Products. Visit us here for more details:<br>
>> <a href="http://ad.doubleclick.net/clk;226879339;13503038;l" target="_blank">http://ad.doubleclick.net/clk;226879339;13503038;l</a>?<br>
>> <a href="http://clk.atdmt.com/CRS/go/247765532/direct/01/" target="_blank">http://clk.atdmt.com/CRS/go/247765532/direct/01/</a><br>
>> _______________________________________________<br>
>> Gdcm-developers mailing list<br>
>> <a href="mailto:Gdcm-developers@lists.sourceforge.net">Gdcm-developers@lists.sourceforge.net</a><br>
>> <a href="https://lists.sourceforge.net/lists/listinfo/gdcm-developers" target="_blank">https://lists.sourceforge.net/lists/listinfo/gdcm-developers</a><br>
><br>
><br>
<br>
<br>
<br>
</div></div>--<br>
<font color="#888888">Mathieu<br>
</font></blockquote></div><br></div></div>