[Dcmlib] Re: DICOM Series Misread

Mathieu Malaterre mathieu.malaterre at kitware.com
Tue Oct 4 20:30:55 CEST 2005


Stephen,

	[CCing dcmlib for archive purpose.]
	Do you have the full gdcm src ? In gdcm/Example, I believe you could 
check the code from:

gdcm/Example/TestCopyDicom.cxx
gdcm/Example/TestFromScratch.cxx

Those files are accessible via viewcvs:
http://cvs.creatis.insa-lyon.fr/viewcvs/viewcvs.cgi/gdcm/

HTH,
Mathieu

Stephen R. Aylward wrote:
> Hi Mathieu,
> 
> I am trying to modify the header of dicom files using gdcm directly (not 
> via ITK).
> 
> The outline of my code is as follows:
> 
> gdcm::File *file = 
> (*(nameGenerator->GetSeriesHelper()->GetCoherentFileList( seriesID 
> )))[fileNum];
> 
> file->SetValEntry( myNewString, 0x0010, 0x0010 );
> 
> fileWriter = new gdcm::FileHelper( file );
> 
> fileWriter->GetImageData();
> 
> fileWriter->Write( newFilename );
> 
> delete fileWriter;
> 
> 
> 
> The problem is that some of the dicom object's pixel data are not being 
> written correctly on some machines.   Seems like a memory issue - so, I 
> have tried different versions of the GetImage/UserData call and the 
> Write/WriteMode function calls.
> 
> Can you provide a small set of code that shows how to read a dicom 
> header and data from one file, modify a field, and write it to another 
> file?
> 
> Thanks,
> Stephen



More information about the Dcmlib mailing list