Presentation State with annotations, from multiple DICOM
Moderator: Moderator Team
Presentation State with annotations, from multiple DICOM
Hi,
Is it possible to create a Presentation State File with standard annotations from multiple DICOM Images, using DCMTK?
I have gone through the documentation of dcmpsmk application and it doesn't provide the information about adding annotations on multiple images.
What I am trying to do here is, I have a study with three images, and I want to save annotations ( Line, Ellipse etc ) and other graphical respresentation to a Presentation State.
Please tell me, the required functions in DCMTK?
Also I would like to know, by using DCMTK, how can I save Presentation State file of a Multiframe Image which include Annotation on different frames.
Thanks!
Pramod
Is it possible to create a Presentation State File with standard annotations from multiple DICOM Images, using DCMTK?
I have gone through the documentation of dcmpsmk application and it doesn't provide the information about adding annotations on multiple images.
What I am trying to do here is, I have a study with three images, and I want to save annotations ( Line, Ellipse etc ) and other graphical respresentation to a Presentation State.
Please tell me, the required functions in DCMTK?
Also I would like to know, by using DCMTK, how can I save Presentation State file of a Multiframe Image which include Annotation on different frames.
Thanks!
Pramod
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
Yes, of course, since the "dcmpstat" module is the result of an officially supported reference implementation.Is it possible to create a Presentation State File with standard annotations from multiple DICOM Images, using DCMTK?
This is correct, "dcmpsmk" does not support this feature.I have gone through the documentation of dcmpsmk application and it doesn't provide the information about adding annotations on multiple images.
See DcmPresentationState::addImageReference().What I am trying to do here is, I have a study with three images, and I want to save annotations ( Line, Ellipse etc ) and other graphical respresentation to a Presentation State. Please tell me, the required functions in DCMTK?
Some aspects of a GSPS object apply to all frames of the referenced images (or to be more precise, to the referenced frames of the referenced images). For other aspects you can choose whether they apply to all referenced images/frames or only to some of them. See API documentation of class DcmPresentationState and DVPresentationState as well as the relevant parts of the DICOM standard for details.Also I would like to know, by using DCMTK, how can I save Presentation State file of a Multiframe Image which include Annotation on different frames.
Thank you Jörg for the reply.
Now I can able to create Presentation State file with multiple DICOM images referenced. And also added multiple Graphic Object in Presentation State file .
But, the graphics objects, which I want to come under each of ReferencedSOPInstanceUID sequence are always coming under the first image's ReferencedSOPInstanceUID sequence.
Following is the way I am creating Presentation state file:
Please tell me where the problem is:
Now I can able to create Presentation State file with multiple DICOM images referenced. And also added multiple Graphic Object in Presentation State file .
But, the graphics objects, which I want to come under each of ReferencedSOPInstanceUID sequence are always coming under the first image's ReferencedSOPInstanceUID sequence.
Following is the way I am creating Presentation state file:
Please tell me where the problem is:
Code: Select all
DVPresentationState state;
OFCondition error = state.createFromImage(*datasetfirstImage, overlayActivation, voiActivation,
curveActivation, shutterActivation, presentationActivation, layering, opt_aetitle,
opt_filesetID, opt_filesetUID);
for(int i = 0; i< strDCMFilePathArray.GetSize(); i++)
{
DcmFileFormat *ff = NULL;
string strPath = DCMFilePathArray.GetAt(i);
if (DVPSHelper::loadFileFormat(strPath, ff) == EC_Normal)
{
if (ff)
{
DcmDataset *dset = ff->getDataset();
state.addImageReference(*dset);
// Adding grpahic objects to Presentation state
state.addGraphicLayer("MEASUREMENT", strLayer);
size_t sz = state.getGraphicLayerIndex("MEASUREMENT");
DVPSGraphicObject* psGraphics = state.addGraphicObject(sz);
Float32 data[] = {100,100,250,250};
psGraphics->setGraphicType(DVPST_polyline);
psGraphics->setData(2, data, DVPSA_pixels);
}
}
delete ff;
}
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
Thank you Jörg for the response.
As per your suggestion I separated the addition of Image references from the addition of graphic layers.
But still, the graphic objects are coming under the first Image Referance Sequence.
I made the following change in the code.
Please guide me to generate a correct result.
As per your suggestion I separated the addition of Image references from the addition of graphic layers.
But still, the graphic objects are coming under the first Image Referance Sequence.
I made the following change in the code.
Please guide me to generate a correct result.
Code: Select all
for(int i = 0; i< nTotalImg; i++)
{
DcmFileFormat *ff = dcFiles[i];
if (ff)
{
DcmDataset *dset = ff->getDataset();
state.addImageReference(*dset);
}
}
for(int i = 0; i< nTotalImg; i++)
{
DcmFileFormat *ff = dcFiles[i];
if (ff)
{
DcmDataset *dset = ff->getDataset();
state.attachImage(dset, OFFalse);
// Adding grpahic objects to Presentation state
state.addGraphicLayer("MEASUREMENT", strLayer);
size_t sz = state.getGraphicLayerIndex("MEASUREMENT");
DVPSGraphicObject* psGraphics = state.addGraphicObject(sz);
Float32 data[] = {100,100,250,250};
psGraphics->setGraphicType(DVPST_polyline);
psGraphics->setData(2, data, DVPSA_pixels);
}
}
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
I just wrote a little sample program that shows how it works in principle. Hope it helps ...
Who is online
Users browsing this forum: Ahrefs [Bot] and 1 guest