Implementation Version Name
Moderator: Moderator Team
Implementation Version Name is just one of the DICOM's tag so inserting it doesn't differ from others.prakash wrote:Ho can i Insert Implementation Version Name to DicomMetaInformation Header using Fileformat or Dataset?
Please Guide me
First look into "PS 3.6" document ("DICOM Part 6: Data Dictionary") and search for "Implementation Version Name". You will find it under section "Registry of DICOM File Meta Elements" where you can find out its tag and Value Representation (VR). In this case it is respectively (0002,0013) and SH.
Value Representation determines what function should be used to inserting such tag. SH means short string, so the proper function will be `setString()' (for details about value representations see "PS 3.5", section 6.2: "VALUE REPRESENTATION (VR)").
Now, when you've collected all needed data, you can write the code:
Code: Select all
DcmTag tag( 0x2, 0x13 );
tag.lookupVRinDictionary(); // We don't need to set VR for known tags ourselfs.
DcmElement * element = new DcmShortString( tag );
element->setString( "New Implementation Version Name" );
dcmFileFormat->getMetaInfo()->insert(
element,
true // replace existing
);
Code: Select all
dcmFileFormat->getMetaInfo()->putAndInsertString( DcmTag( 0x2, 0x13), "New Implementation Version Name" );
Code: Select all
dcmFileFormat->getMetaInfo()->putAndInsertString( DcmTag( some tag with float VR), "0.145" );
this is my code , can u suggest me where i am going wrong
DcmItem *metaInfo = dcm_dcmfrmt.getMetaInfo();
if (metaInfo)
{
delete metaInfo->remove(DCM_ImplementationVersionName);
}
DcmTag tag( 0x2, 0x13 );
tag.lookupVRinDictionary();
DcmElement * element = new DcmShortString( tag );
element->putString( ConvertBSTRToChar(_DcmDemographicInfo.SoftwareVersionName) );
metaInfo->insert(
element,
true
);
dcm_dcmfrmt.loadAllDataIntoMemory();
dcm_ofstatus=dcm_dcmfrmt.saveFile((const char*)DCMFilePath,
EXS_MPEG2MainProfileAtMainLevel);
if(dcm_ofstatus.bad())
{
_DcmErrorCode=QDCM_ERRORINSAVINGMPEG2DICOMFILE;
_DcmErrorString = dcm_ofstatus.text();
return S_FALSE;
}
DcmItem *metaInfo = dcm_dcmfrmt.getMetaInfo();
if (metaInfo)
{
delete metaInfo->remove(DCM_ImplementationVersionName);
}
DcmTag tag( 0x2, 0x13 );
tag.lookupVRinDictionary();
DcmElement * element = new DcmShortString( tag );
element->putString( ConvertBSTRToChar(_DcmDemographicInfo.SoftwareVersionName) );
metaInfo->insert(
element,
true
);
dcm_dcmfrmt.loadAllDataIntoMemory();
dcm_ofstatus=dcm_dcmfrmt.saveFile((const char*)DCMFilePath,
EXS_MPEG2MainProfileAtMainLevel);
if(dcm_ofstatus.bad())
{
_DcmErrorCode=QDCM_ERRORINSAVINGMPEG2DICOMFILE;
_DcmErrorString = dcm_ofstatus.text();
return S_FALSE;
}
I have this one after your suggestion
DcmItem *metaInfo = dcm_dcmfrmt.getMetaInfo();
if (metaInfo)
{
delete metaInfo->remove(DCM_ImplementationVersionName);
}
dcm_ofstatus=dcm_dcmfrmt.saveFile((const char*)DCMFilePath,
EXS_MPEG2MainProfileAtMainLevel,EET_ExplicitLength,EGL_withGL,EPD_withoutPadding);
if(dcm_ofstatus.bad())
{
_DcmErrorCode=QDCM_ERRORINSAVINGMPEG2DICOMFILE;
_DcmErrorString = dcm_ofstatus.text();
return S_FALSE;
}
DcmItem *metaInfo = dcm_dcmfrmt.getMetaInfo();
if (metaInfo)
{
delete metaInfo->remove(DCM_ImplementationVersionName);
}
dcm_ofstatus=dcm_dcmfrmt.saveFile((const char*)DCMFilePath,
EXS_MPEG2MainProfileAtMainLevel,EET_ExplicitLength,EGL_withGL,EPD_withoutPadding);
if(dcm_ofstatus.bad())
{
_DcmErrorCode=QDCM_ERRORINSAVINGMPEG2DICOMFILE;
_DcmErrorString = dcm_ofstatus.text();
return S_FALSE;
}
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
As you can read in other postings, you should change the definitions in dcmtk/dcmdata/include/dcmtk/dcmdata/dcuid.h if required. However, I don't see any reason to change this information. If you are using the DCMTK, implementation version name and implementation class UID should refer to this toolkit!
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
If your application just writes (stores) DICOM files it has read or received from a third party system, you should use the Implementation Class UID and Implementation Version Name of the underlying DICOM toolkit (in this case DCMTK -- which is the default as you can read above).
If your application creates new SOP Instances (i.e. the content of the dataset), you should check the Equipment Modules applicable to the IOD you are using. Possible DICOM attributes are: Manufacturer, Manufacturer's Model Name, Software Versions and the like from the General Equipment Module.
If your application creates new SOP Instances (i.e. the content of the dataset), you should check the Equipment Modules applicable to the IOD you are using. Possible DICOM attributes are: Manufacturer, Manufacturer's Model Name, Software Versions and the like from the General Equipment Module.
Who is online
Users browsing this forum: Google [Bot] and 1 guest