[Insight-users] Problwm reading & writing unsigned int Dicom Files

Martin Waitzbauer mazzok at gmx.at
Mon Nov 7 10:58:37 EST 2011


Hello,

Ive been facing problems when readinga simple dicom file, and rewriting it without any modifications again.

The rewritten dicom file has its values shifted in comparison to the original

this is the code i use:
very basic indeed, only one reader and one writer
can someone help me please?
best regards
Maz


typedef itk::ImageFileReader<itk::Image<unsigned int, 2>>							ReaderType;
typedef itk::ImageFileWriter<itk::Image<unsigned int,2>>							WriterType;
	reader1->SetImageIO( gdcmImageIO )
try{


		reader1->SetFileName("C:/Users/Mazzok/Documents/TESTPIC/A.dcm");
		reader1->Update();

		}catch(itk::ExceptionObject e){
			std::cout<<e.GetDescription();
		}

		try{
		WriterType::Pointer writer = WriterType::New();
		writer->SetInput(reader1->GetOutput());
		writer->SetImageIO( gdcmImageIO );
		writer->UseInputMetaDataDictionaryOff ();
		writer ->SetFileName( "C:/Users/Mazzok/Documents/TESTPIC/A_mod.dcm");
		writer->Update();
		}catch(itk::ExceptionObject e1){
			std::cout<<e1.GetDescription();
		} 
-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!		
Jetzt informieren: http://www.gmx.net/de/go/freephone


More information about the Insight-users mailing list