Creating MammographyCADSR file
Moderator: Moderator Team
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
Hello again to all! I hope you enjoyed nice summer holidays, now back to work...
Unfortunately, this doesn't answer the second question: "is this rendering a GUI related issue or I am still wrong with something in the SR?". Since my guess was correct, my file should have been still fully DICOM SR compliant.
Anyway, this is a secondary issue at this moment. Right now, I am testing another DICOM visualization software (Alma3D) and the CAD SR test files are not displayed at all. There is also an error message saying something about "Invalid Study Date/Time" (very comprehensible since I didn't wrote in the CAD SR file that information). While geting these two parameters from the DICOM image file is a piece of cake (see the previously provided code:
), their set in the generated DSR file is far from being obvious. If the DSRDocument method setStudyID() [corresponding to getStudyInstanceUID ()] works fine, there is no method corresponding to getStudyDate() or getStudyTime(). So, my top-level question is: how to set correctly Study Date & Time in a DSR file? I tried
just after setting the StudyID, but these lines put the informations in a different node of the tree.
Thank you for your help.
This is the implicit answer to my first (and essentialy easy) question, "is my guess (about the meaning of inserted coordinates) right?!" Since the guess was "[...] the first integer couple gives the center, while the second is a point pertaining to the circle" and the DICOM standard reads "a circle defined by two (column,row) pairs. The first point is the central pixel. The second point is a pixel on the perimeter of the circle.", I think the answer was affirmative.Jörg Riesmeier wrote:The exact definition of the different Graphic Types (like CIRCLE, ELLIPSE, etc.) can be found in part 3 of the DICOM standard (see section C.18.6.1.2).
Unfortunately, this doesn't answer the second question: "is this rendering a GUI related issue or I am still wrong with something in the SR?". Since my guess was correct, my file should have been still fully DICOM SR compliant.
Anyway, this is a secondary issue at this moment. Right now, I am testing another DICOM visualization software (Alma3D) and the CAD SR test files are not displayed at all. There is also an error message saying something about "Invalid Study Date/Time" (very comprehensible since I didn't wrote in the CAD SR file that information). While geting these two parameters from the DICOM image file is a piece of cake (see the previously provided code:
Code: Select all
fform[dix].getDataset()->findAndGetOFString(DCM_PatientsSex,patientsSex);
fform[dix].getDataset()->findAndGetOFString(DCM_StudyDate,studyDate); /// not used!
fform[dix].getDataset()->findAndGetOFString(DCM_StudyTime,studyTime); /// not used!
Code: Select all
doc->setContentDate(studyDate);
doc->setContentTime(studyTime);
Thank you for your help.
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
StudyDate and StudyTime are type 2 elements, i. e. they have to be present in the dataset but their value might be empty. Therefore, the API only provides "get" but no "set" methods. Please keep in mind that the module "dcmsr" was originally developed to add SR support to DICOMscope and that there was no need for these attributes for this purpose.
Solution: You could either add the missing "set" methods to the class or you could add these two data elements directly to the dataset that is written by the DSRDocument::write() method.
Solution: You could either add the missing "set" methods to the class or you could add these two data elements directly to the dataset that is written by the DSRDocument::write() method.
After various tests, it turned out that StudyDate and StudyTime are not the relevant missing tags, but the StudyInstanceUID which is of course obtainable with getStudyInstanceUID(). The same question remains: how to set it in the DSR file (since there is no setStudyInstanceID()). I have a nasty feeling that there is a same...Jörg Riesmeier wrote:StudyDate and StudyTime are type 2 elements, i. e. they have to be present in the dataset but their value might be empty. Therefore, the API only provides "get" but no "set" methods. Please keep in mind that the module "dcmsr" was originally developed to add SR support to DICOMscope and that there was no need for these attributes for this purpose.
... for this issue. I would prefer not to touch any part of dcmtk package by adding methods to the class, but to insert the StudyInstanceUID with a DSRDocument::write(...). Inspired from tried to insert a code lineSolution: You could either add the missing "set" methods to the class or you could add these two data elements directly to the dataset that is written by the DSRDocument::write() method.
Code: Select all
doc->write(*fform[0].getDataset());
Actually, there is a simpler way: it's enough to add a single line in the code, after the creation of the document...zappy1 wrote: [ I would prefer not to touch any part of dcmtk package by adding methods to the class, but to insert the StudyInstanceUID with a DSRDocument::write(...). [...] Or there is another simpler way to do it?
Code: Select all
doc->createNewDocument(DSRTypes::DT_MammographyCadSR);
doc->createNewSeriesInStudy(studyInstanceUID);
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
If you want to create a new series for your SR document which is part of an existing study, why don't you use DSRDocument::createNewSeriesInStudy()? See mkreport.cc for details on how to use it.
Ok, I saw your posting only after I pressed the "submit" button
Ok, I saw your posting only after I pressed the "submit" button
For what's worth: the StudyDate and StudyTime can be inserted through the following code lines:zappy1 wrote:After various tests, it turned out that StudyDate and StudyTime are not the relevant missing tags, but the StudyInstanceUID which is of course obtainable with getStudyInstanceUID(). The same question remains: how to set it in the DSR file (since there is no setStudyInstanceID()). I have a nasty feeling that there is a same...Jörg Riesmeier wrote:StudyDate and StudyTime are type 2 elements, i. e. they have to be present in the dataset but their value might be empty. Therefore, the API only provides "get" but no "set" methods.
[...] should I create a stack of DcmObjects to be written in the DSR file as second argument of the write() method? Is there any sample code for this procedure? Or there is another simpler way to do it?Solution: You could either add the missing "set" methods to the class or you could add these two data elements directly to the dataset that is written by the DSRDocument::write() method.
Code: Select all
// the output SR file definition
DcmFileFormat *newfileformat = new DcmFileFormat();
OFCondition status = doc->write(*newfileformat->getDataset());
// inserting studyDate & studyTime previously defined
DSRTypes::putStringValueToDataset(*newfileformat->getDataset(),DCM_StudyDate,studyDate,OFFalse);
DSRTypes::putStringValueToDataset(*newfileformat->getDataset(),DCM_StudyTime,studyTime,OFFalse);
// followed by saving the whole
newfileformat->saveFile(outfile, EXS_LittleEndianExplicit);
Regards,
Z.B.
Who is online
Users browsing this forum: No registered users and 1 guest