Hi
I am working dcmtk 3.6.0.
I need to insert meta header(DcmMetaInfo) tag 0002,0016 to dataset (DcmDataset)? Does it possible to do that? if yes how can i do that?
Thanks in Advance.
Insert meta header to dataset
Moderator: Moderator Team
-
- Posts: 41
- Joined: Tue, 2013-07-23, 12:15
- Location: Chennai, India
Insert meta header to dataset
Thanks
Guna
Guna
-
- DCMTK Developer
- Posts: 2055
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Re: Insert meta header to dataset
Hi,
do something like this (add error checks where necessary):
Best regards,
Michael
do something like this (add error checks where necessary):
Code: Select all
DcmFileFormat dcmff;
dcmff.loadFile("file.dcm");
// Most relevant part:
dcmff.getMetaInfo()->putAndInsertOFStringArray(DCM_SourceApplicationEntityTitle, "DESIREDAETITLE");
dcmff.saveFile();
Michael
-
- Posts: 41
- Joined: Tue, 2013-07-23, 12:15
- Location: Chennai, India
Re: Insert meta header to dataset
Hi
Not like that.
I have meta header information(8 elements) in DcmMetaInfo metaInfo variable.
I have dataset information (all dataset elements) in DcmDataset dataset variable.
now i need to insert 0002,0016 from metaInfo variable to dataset variable dataset without saving the file/image.
Did you get my problem? Thanks.
Not like that.
I have meta header information(8 elements) in DcmMetaInfo metaInfo variable.
I have dataset information (all dataset elements) in DcmDataset dataset variable.
now i need to insert 0002,0016 from metaInfo variable to dataset variable dataset without saving the file/image.
Did you get my problem? Thanks.
Thanks
Guna
Guna
-
- DCMTK Developer
- Posts: 2055
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Re: Insert meta header to dataset
Hi,
yes, understood. But the tag 0002,0016 (i.e. group number 0002) is not permitted in a dataset according to the DICOM standard.
Otherwise just copy the value to any other tag:
Fell free to find another tag that makes more sense to you.
I think DCMTK will also accept
but writing or transferring such a dataset is not standard conform, will not work or will cause errors at the receiver's side.
Best regards,
Michael
yes, understood. But the tag 0002,0016 (i.e. group number 0002) is not permitted in a dataset according to the DICOM standard.
Otherwise just copy the value to any other tag:
Code: Select all
OFString val;
metainfo->findAndGetOFStringValue(DCM_SourceApplicationEntityTitle, val);
dataset->putAndInsertOFStringArray(DCM_ImageComments, val);
I think DCMTK will also accept
Code: Select all
dataset->putAndInsertOFStringArray(DCM_SourceApplicationEntityTitle, val);
Best regards,
Michael
-
- Posts: 41
- Joined: Tue, 2013-07-23, 12:15
- Location: Chennai, India
Who is online
Users browsing this forum: Baidu [Spider], Google [Bot] and 0 guests