[ITK] [ITK-users] Saving results .dcm files

Abdelkhalek Bakkari bakkari.abdelkhalek at hotmail.fr
Wed Mar 16 08:33:07 EDT 2016


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>          with2>          [2>              TPixel=InputPixelType,2>              VImageDimension=22>          ]2>          C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(279) : see declaration of 'itk::Image<TPixel,VImageDimension>::~Image'2>          with2>          [2>              TPixel=InputPixelType,2>              VImageDimension=22>          ]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>          with2>          [2>              TPixel=InputPixelType,2>              VImageDimension=22>          ]2>          C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(276) : see declaration of 'itk::Image<TPixel,VImageDimension>::Image'2>          with2>          [2>              TPixel=InputPixelType,2>              VImageDimension=22>          ]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>          with2>          [2>              TPixel=InputPixelType,2>              VImageDimension=22>          ]2>          C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(279) : see declaration of 'itk::Image<TPixel,VImageDimension>::~Image'2>          with2>          [2>              TPixel=InputPixelType,2>              VImageDimension=22>          ]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>          with2>          [2>              TPixel=InputPixelType,2>              VImageDimension=22>          ]2>          C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(294) : compiler has generated 'itk::Image<TPixel,VImageDimension>::~Image' here2>          with2>          [2>              TPixel=InputPixelType,2>              VImageDimension=22>          ]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>          with2>          [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>          with2>          [2>              TPixel=InputPixelType,2>              VImageDimension=22>          ]2>          C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(276) : see declaration of 'itk::Image<TPixel,VImageDimension>::Image'2>          with2>          [2>              TPixel=InputPixelType,2>              VImageDimension=22>          ]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>          with2>          [2>              TPixel=OutputImageType,2>              VImageDimension=22>          ]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>          with2>          [2>              TPixel=InputPixelType,2>              VImageDimension=22>          ]2>          C:/ITK 4.8.1/Source/Modules/Core/Common/include\itkImage.h(279) : see declaration of 'itk::Image<TPixel,VImageDimension>::~Image'2>          with2>          [2>              TPixel=InputPixelType,2>              VImageDimension=22>          ]  

Abdelkhalek BakkariPh.D candidate in Computer ScienceInstitute of Applied Computer ScienceLodz 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 BakkariPh.D candidate in Computer ScienceInstitute of Applied Computer ScienceLodz 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 --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160316/2d01b110/attachment-0001.html>
-------------- next part --------------
_____________________________________
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


More information about the Community mailing list