[ITK-users] Saving results .dcm files

Dženan Zukić dzenanz at gmail.com
Wed Mar 16 15:26:53 EDT 2016


Hi Abdelkhalek,

the problem does not seem to be there. The attached example compiles
fine for me.

Regards,
Dženan

On Wed, Mar 16, 2016 at 8:33 AM, Abdelkhalek Bakkari
<bakkari.abdelkhalek at hotmail.fr> wrote:
> I tried to write the following code :
>
>
> /////////////////// Begin Dicom Writer
>
> ReaderType::Pointer reader = ReaderType::New();
> ImageIOType::Pointer gdcmIO = ImageIOType::New();
> NamesGeneratorType::Pointer namesGenerator = NamesGeneratorType::New();
>
> itksys::SystemTools::MakeDirectory( "slic" );
> SeriesWriterType::Pointer seriesWriter = SeriesWriterType::New();
> seriesWriter->SetInput( reader->GetOutput() );
> seriesWriter->SetImageIO( gdcmIO );
> namesGenerator->SetOutputDirectory("slic");
> seriesWriter->SetFileNames( namesGenerator->GetOutputFileNames());
> seriesWriter->SetMetaDataDictionaryArray(
> reader->GetMetaDataDictionaryArray() );
>
>    ////////////////// End Dicom Writer
>
> Some errors appear :
>
> c:\itk
> 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(184):
> error C2248: 'itk::Image<TPixel,VImageDimension>::~Image' : cannot access
> protected member declared in class 'itk::Image<TPixel,VImageDimension>'
> 2>          with
> 2>          [
> 2>              TPixel=InputPixelType,
> 2>              VImageDimension=2
> 2>          ]
> 2>          C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(279)
> : see declaration of 'itk::Image<TPixel,VImageDimension>::~Image'
> 2>          with
> 2>          [
> 2>              TPixel=InputPixelType,
> 2>              VImageDimension=2
> 2>          ]
> 2>c:\itk
> 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(188):
> error C2248: 'itk::Image<TPixel,VImageDimension>::Image' : cannot access
> protected member declared in class 'itk::Image<TPixel,VImageDimension>'
> 2>          with
> 2>          [
> 2>              TPixel=InputPixelType,
> 2>              VImageDimension=2
> 2>          ]
> 2>          C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(276)
> : see declaration of 'itk::Image<TPixel,VImageDimension>::Image'
> 2>          with
> 2>          [
> 2>              TPixel=InputPixelType,
> 2>              VImageDimension=2
> 2>          ]
> 2>c:\itk
> 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(188):
> error C2248: 'itk::Image<TPixel,VImageDimension>::~Image' : cannot access
> protected member declared in class 'itk::Image<TPixel,VImageDimension>'
> 2>          with
> 2>          [
> 2>              TPixel=InputPixelType,
> 2>              VImageDimension=2
> 2>          ]
> 2>          C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(279)
> : see declaration of 'itk::Image<TPixel,VImageDimension>::~Image'
> 2>          with
> 2>          [
> 2>              TPixel=InputPixelType,
> 2>              VImageDimension=2
> 2>          ]
> 2>c:\itk
> 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(213):
> error C2248: 'itk::Image<TPixel,VImageDimension>::~Image' : cannot access
> protected member declared in class 'itk::Image<TPixel,VImageDimension>'
> 2>          with
> 2>          [
> 2>              TPixel=InputPixelType,
> 2>              VImageDimension=2
> 2>          ]
> 2>          C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(294)
> : compiler has generated 'itk::Image<TPixel,VImageDimension>::~Image' here
> 2>          with
> 2>          [
> 2>              TPixel=InputPixelType,
> 2>              VImageDimension=2
> 2>          ]
> 2>          c:\itk
> 4.8.1\source\modules\core\common\include\itkImportImageContainer.hxx(209) :
> while compiling class template member function 'void
> itk::ImportImageContainer<TElementIdentifier,TElement>::DeallocateManagedMemory(void)'
> 2>          with
> 2>          [
> 2>              TElementIdentifier=unsigned long,
> 2>              TElement=itk::Image<InputPixelType,2>
> 2>          ]
> 2>c:\itk 4.8.1\source\modules\core\common\include\itkImage.hxx(151): error
> C2248: 'itk::Image<TPixel,VImageDimension>::Image' : cannot access protected
> member declared in class 'itk::Image<TPixel,VImageDimension>'
> 2>          with
> 2>          [
> 2>              TPixel=InputPixelType,
> 2>              VImageDimension=2
> 2>          ]
> 2>          C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(276)
> : see declaration of 'itk::Image<TPixel,VImageDimension>::Image'
> 2>          with
> 2>          [
> 2>              TPixel=InputPixelType,
> 2>              VImageDimension=2
> 2>          ]
> 2>          c:\itk
> 4.8.1\source\modules\core\common\include\itkImage.hxx(148) : while compiling
> class template member function 'unsigned int
> itk::Image<TPixel,VImageDimension>::GetNumberOfComponentsPerPixel(void)
> const'
> 2>          with
> 2>          [
> 2>              TPixel=OutputImageType,
> 2>              VImageDimension=2
> 2>          ]
> 2>c:\itk 4.8.1\source\modules\core\common\include\itkImage.hxx(151): error
> C2248: 'itk::Image<TPixel,VImageDimension>::~Image' : cannot access
> protected member declared in class 'itk::Image<TPixel,VImageDimension>'
> 2>          with
> 2>          [
> 2>              TPixel=InputPixelType,
> 2>              VImageDimension=2
> 2>          ]
> 2>          C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(279)
> : see declaration of 'itk::Image<TPixel,VImageDimension>::~Image'
> 2>          with
> 2>          [
> 2>              TPixel=InputPixelType,
> 2>              VImageDimension=2
> 2>          ]
>
> Abdelkhalek Bakkari
> Ph.D candidate in Computer Science
> Institute of Applied Computer Science
> Lodz University of Technology, Poland
>
>
>
>
> ________________________________
> From: kiran.j88 at gmail.com
> Date: Wed, 16 Mar 2016 10:27:51 +0000
> Subject: Re: [ITK-users] Saving results .dcm files
> To: bakkari.abdelkhalek at hotmail.fr; insight-users at itk.org
>
>
> Hi Abdelkhalek,
>
> Examples can be found in Chapter 1 of Book 2 of the ITK Software guide:
> http://www.itk.org/ItkSoftwareGuide.pdf
> See page 340 of the pdf.
>
> You can find the full source code for the examples on the ITK Doxygen pages,
> e.g.:
> http://www.itk.org/Doxygen/html/Examples_2IO_2DicomSeriesReadSeriesWrite_8cxx-example.html
>
> And there are more examples on the ITK wiki, e.g.:
> http://itk.org/Wiki/ITK/Examples/DICOM/ResampleDICOM
>
> Regards,
> Kiran
>
>
> On Wed, 16 Mar 2016 at 10:19 Abdelkhalek Bakkari
> <bakkari.abdelkhalek at hotmail.fr> wrote:
>
>
> Hi !
>
> I am looking for saving the results of ITK as  .dcm files for a 3D image.
> Any help ! Any suggestion ! please.
>
> Best regards,
>
> Abdelkhalek Bakkari
> Ph.D candidate in Computer Science
> Institute of Applied Computer Science
> Lodz University of Technology, Poland
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tester.cpp
Type: text/x-c++src
Size: 1024 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20160316/1bb395db/attachment.cpp>


More information about the Insight-users mailing list