- assigned_to: Mathieu Malaterre
- Priority: 5 --> 9
For a project, I have to convert a Radiation Dose SR dicom file to
xml, modify few data and the convert the xml back to a dicom file.
I attempted to do this with gdcmxml but converting from xml to dicom failed.
I thus tried the following: dicom --> xml --> dicom still with gdcmxml (without modification in the xml file)
and .. it failed.
The dicom file i used if the file DoseSR_GE_03.DCM which cen be found here:
ftp://medical.nema.org/medical/dicom/DataSets/WG02/RDSR
I recompiled gdcmxml into debug configuration and I found the
following concerns
1) when loading the xml file, fread (line 672, function XMLtoDICOM)
reads less bytes than expected when the file is opened by
in = fopen(file1.GetFileName(), "r"); --> the if( numBytes != ret )
fails and function returns
I commented the checks so that I could reach the "WriteDICOM(....)"
statement but at this point, process enters a loop it never exists.
It seems to me that the problem comes from the line
"while (!(CHECK_NAME("DicomAttribute") == 0 &&
xmlTextReaderDepth(reader) == (depth - 1) && xmlTextReaderNodeType(reader) == 15))"
in the function "HandleSequence". The loop never ends...and this seems
to come from libxml:
in file xmlreader.c, function const xmlChar xmlTextReaderConstName(xmlTextReaderPtr reader), statement node =reader->curnode;
after a while node & reader->curnode are always equal...
V