DICOM @ OFFIS

Discussion Forum for OFFIS DICOM Tools - For registration, send email with desired user name to the OFFIS DICOM team
It is currently Mon, 2018-09-24, 23:52

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue, 2018-05-22, 10:18 
Offline

Joined: Tue, 2018-05-22, 10:14
Posts: 4
I'm using the version 3.6.3 of dcmtk. I would like to save diffrent measurements in dicom with the Template 300 Measurement. My question is:
Is there a possibility to convert a measurement object to a DcmDataset? Or are there any other similar formats to convert it?


Top
 Profile  
 
PostPosted: Tue, 2018-05-22, 17:17 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1975
Location: Oldenburg, Germany
TID300_Measurement is a sub-template that can be inserted into a root template (or the internally stored sub-tree can be inserted into a document tree) and then into an instance of DSRDocument. The latter provides a write() method that outputs its content to a DcmDataset. In principle, you could also write the DSRDocumentTree into a DcmDataset but this would probably make no sense.


Top
 Profile  
 
PostPosted: Wed, 2018-05-23, 09:39 
Offline

Joined: Tue, 2018-05-22, 10:14
Posts: 4
I try creating a TID1500 Measurement Report and save the measurement also as TID300 Measurement in the measurement group. The report and the group as well as the measurement is valid. But when I want to verify the measurement reading the dataset there is no measurement group and also no measurement in the dataset. Also when I save the dataset to a dcm file, there is only the sr header but no measurement information.


Top
 Profile  
 
PostPosted: Wed, 2018-05-23, 12:14 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1975
Location: Oldenburg, Germany
Did you actually insert the TID1500_MeasurementReport into the DSRDocument instance (e.g. using setTreeFromRootTemplate())? Could you post a minimal example that demonstrates what you've described?


Top
 Profile  
 
PostPosted: Wed, 2018-05-23, 13:32 
Offline

Joined: Tue, 2018-05-22, 10:14
Posts: 4
Code:
TID1500_MeasurementReport report( CMR_CID7021::ImagingMeasurementReport );
status = report.addIndividualMeasurements( true );
auto group = report.getIndividualMeasurements();
char* uid  = new char[100];
dcmGenerateUniqueIdentifier( uid );
status = group.setTrackingUniqueIdentifier( uid, true );
status = group.setTrackingIdentifier( "Diameter1" );
const CMR_SRNumericMeasurementValueWithUnits<CID7181_AbstractMultiDimensionalImageModelComponentUnits>
    value("12", CID7181_AbstractMultiDimensionalImageModelComponentUnits::EnumType::Millimeter, true);
status = group.addMeasurement(CID7469_GenericIntensityAndSizeMeasurements::EnumType::Diameter, value, true);
auto measurement = group.getMeasurement();
/* add spatial coordinates and real world value map to measurement (for the beginning I only added those items) */
DSRDocument* doc = new DSRDocument();
DcmFileFormat fileformat;
if ( doc->setTreeFromRootTemplate( report ).good() )
  doc->print( cout, DSRTypes::PF_printConceptNameCodes );
status = doc->write( *fileformat.getDataset() );
if ( status.good() )
{
  status = fileformat.saveFile( "test.dcm", EXS_LittleEndianExplicit );
}


Yes I have.
The 'status' is always good. I also added an observer context, a language and a procedure reported to the report. If I call
Code:
report.isValid();
it is true (the same with group and measurement). But there isn't any measurement information in the dcm file (or dataset) only the observer context, language...


Top
 Profile  
 
PostPosted: Wed, 2018-05-23, 13:38 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1975
Location: Oldenburg, Germany
I guess that the "auto" keyword in your code creates a local variable of the required type (i.e. a copy). However, what you actually need is a reference in order to modify the internally managed measurements (i.e. "auto &" or the respective by-reference type, which is what prefer).


Top
 Profile  
 
PostPosted: Wed, 2018-05-23, 21:26 
Offline
DCMTK Developer

Joined: Tue, 2011-05-03, 14:38
Posts: 1975
Location: Oldenburg, Germany
Btw, instead of CID7469_GenericIntensityAndSizeMeasurements::EnumType::Diameter you could also write CMR_CID7469::Diameter, which is much shorter.


Top
 Profile  
 
PostPosted: Thu, 2018-05-24, 06:33 
Offline

Joined: Tue, 2018-05-22, 10:14
Posts: 4
Thank you very much!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group