Hi everyone,
I created DICOM SR that contain Value Type TEXT. It had (0040,a160) Text Value - ございます.
Then I read it again. But not success.
Why?
Thank for supporting!
Why could not I read again DICOM SR that I created?
Moderator: Moderator Team
-
- Posts: 28
- Joined: Mon, 2016-05-09, 08:32
-
- DCMTK Developer
- Posts: 2504
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Why could not I read again DICOM SR that I created?
I'm sorry but without more details I'll not be able to help you.
E.g., I would need to know:
E.g., I would need to know:
- Which version of the DCMTK you use.
- How you've created the SR document.
- What do you mean by "Then I read it again. But not success.".
- What is the output of "dsrdump" on this SR document (in debug mode)...
-
- Posts: 28
- Joined: Mon, 2016-05-09, 08:32
Re: Why could not I read again DICOM SR that I created?
My application uses dctm version 3.6.0J. Riesmeier wrote:I'm sorry but without more details I'll not be able to help you.
E.g., I would need to know:
First of all, I would recommend that you try it again with the latest DCMTK snapshot.
- Which version of the DCMTK you use.
- How you've created the SR document.
- What do you mean by "Then I read it again. But not success.".
- What is the output of "dsrdump" on this SR document (in debug mode)...
Step 1: I create a DICOM SR that contains content item "TEXT". This content item has value "ございます" (Japanese letters)
Code
Code: Select all
std::string input = "ございます"; // If I change input by my name or any string ("VietNam", "DCMTK" ,...)
std::string output;
DSRDocument * dcmSRDoc = new DSRDocument();
dcmSRDoc->createNewDocument(DSRTypes::DT_EnhancedSR);
// Init dcmSRDoc
// some codes here
dcmSRDoc->getTree().getCurrentContentItem().setConceptName(DSRCodedEntryValue("121206", "DCM", CodeMeaning);
dcmSRDoc->getTree().getCurrentContentItem().setCodeValue(DSRCodedEntryValue("121206", "DCM", CodeMeaning1);
// Add Content item TEXT
dcmSRDoc->getTree().addContentItem(DSRTypes::RT_hasProperties, DSRTypes::VT_Text, DSRTypes::AM_belowCurrent);
dcmSRDoc->getTree().getCurrentContentItem().setConceptName(DSRCodedEntryValue("121230", "DCM", "TEXT INPUT"));
// Encode input variable => output
Set Text Value
dcmSRDoc->getTree().getCurrentContentItem().setStringValue(output);
Code: Select all
DcmFileFormat* FileFormat = new DcmFileFormat();
FileFormat->loadFile(DICOMSRFilePath);
DSRDocument* pDICOMSRDoc = new DSRDocument();
DcmDataset *dset = FileFormat ->getDataset();
OFCondition cond = pDICOMSRDoc->read(*dset, 0);
Therefore, I could not get the information from the DICOM SR if I input the Japanese letters
-
- DCMTK Developer
- Posts: 2504
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: Why could not I read again DICOM SR that I created?
Following my previous posting, I would like to ask you to try the current DCMTK snapshot first. This version also allows you to disable the VR checker by calling "dcmEnableVRCheckerForStringValues.set(OFFalse)". The following excerpt is from "dcmtk/dcmdata/dcbytstr.h":
Code: Select all
/** This flag defines whether the VR checker is actually used by the various
* checkStringValue() methods. Since this checker is currently limited to
* ASCII and Latin-1, and the detection of the character set might fail for
* incorrectly encoded DICOM datasets, this check can be disabled globally.
* Please note, however, that other checks (i.e. VM and max. value length)
* are still performed if the optional parameters are set accordingly.
* By default, the VR checker is enabled (value: "OFTrue").
*/
extern DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmEnableVRCheckerForStringValues; /* default: OFTrue */
-
- Posts: 28
- Joined: Mon, 2016-05-09, 08:32
Re: Why could not I read again DICOM SR that I created?
Thank pro.J. Riesmeier wrote:Following my previous posting, I would like to ask you to try the current DCMTK snapshot first. This version also allows you to disable the VR checker by calling "dcmEnableVRCheckerForStringValues.set(OFFalse)". The following excerpt is from "dcmtk/dcmdata/dcbytstr.h":
Code: Select all
/** This flag defines whether the VR checker is actually used by the various * checkStringValue() methods. Since this checker is currently limited to * ASCII and Latin-1, and the detection of the character set might fail for * incorrectly encoded DICOM datasets, this check can be disabled globally. * Please note, however, that other checks (i.e. VM and max. value length) * are still performed if the optional parameters are set accordingly. * By default, the VR checker is enabled (value: "OFTrue"). */ extern DCMTK_DCMDATA_EXPORT OFGlobal<OFBool> dcmEnableVRCheckerForStringValues; /* default: OFTrue */
I will try to do it
Who is online
Users browsing this forum: Google [Bot] and 1 guest