how can i get pixel data from a file in tag (7FE0,0010)
Moderator: Moderator Team
-
- Posts: 19
- Joined: Wed, 2005-02-09, 08:44
how can i get pixel data from a file in tag (7FE0,0010)
Hi
I am creating a DcmTag() with group and element as (7FE0,0010)
how can I insert value of pixel data available in a file to this tag?
I am creating a DcmTag() with group and element as (7FE0,0010)
how can I insert value of pixel data available in a file to this tag?
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
For 8 bit pixel data (VR=OB) you could use something like the following (example taken from the documentation):
In order to get the value of the pixel data element use findAndGetUint8Array() accordingly.
Code: Select all
dataset->putAndInsertUint8Array(DCM_PixelData, pixelData, pixelLength);
-
- Posts: 19
- Joined: Wed, 2005-02-09, 08:44
thanks for your help, how can i put sequence & valus 4datase
in the example given what is pixelData and pixelLength in function
putAndInsertUint8Array()
how can we provide pixel data to this program? Should we store it in a seperate file?
dataset->putAndInsertUint8Array(DCM_PixelData, pixelData, pixelLength);
How can I put values to a sequence like ref image sequence and put values to diffrent elements of the sequence (SOP class and Ist UID)
inside a dataset
dataset->putAndInsertStrig(DM_ReferencedImageSequence, "Doe^John");
putAndInsertUint8Array()
how can we provide pixel data to this program? Should we store it in a seperate file?
dataset->putAndInsertUint8Array(DCM_PixelData, pixelData, pixelLength);
How can I put values to a sequence like ref image sequence and put values to diffrent elements of the sequence (SOP class and Ist UID)
inside a dataset
dataset->putAndInsertStrig(DM_ReferencedImageSequence, "Doe^John");
-
- DCMTK Developer
- Posts: 2055
- Joined: Fri, 2004-11-05, 13:47
- Location: Oldenburg, Germany
- Contact:
Hi,
take a look at the API documentation for DcmItem shipped with your DCMTK release or online (class DcmItem). pixelData and pixelLength is documented there, too. You don't need (are not able) to load a speparate file directly into an element value.
Use findOrCreateSequenceItem() of class DcmItem to insert items in a sequence. To insert an element into an existing sequence item, use findAndGetSequenceItem() to get the item and insert elements into the resulting item like you did before with e.g. pixelData.
Regards,
Michael
take a look at the API documentation for DcmItem shipped with your DCMTK release or online (class DcmItem). pixelData and pixelLength is documented there, too. You don't need (are not able) to load a speparate file directly into an element value.
Use findOrCreateSequenceItem() of class DcmItem to insert items in a sequence. To insert an element into an existing sequence item, use findAndGetSequenceItem() to get the item and insert elements into the resulting item like you did before with e.g. pixelData.
Regards,
Michael
-
- Posts: 19
- Joined: Wed, 2005-02-09, 08:44
how to put data inside diffrent items in a sequence
Hi Michael
Thanks for your help. I am not getting a clear picture of sequence even now. I am able to create a sequence with findOrCreateSequenceItem(). I am able to explicitly specify the size of the sequence also.
But what ever DcmElement values i am putting inside a DcmItem object it is all going inside 1st Item. how can I add more items with diffrent elemnts in it. Like how can I insert into 4th item of sequence etc...Could you please demonstrate with an example?
Thanks for your help. I am not getting a clear picture of sequence even now. I am able to create a sequence with findOrCreateSequenceItem(). I am able to explicitly specify the size of the sequence also.
But what ever DcmElement values i am putting inside a DcmItem object it is all going inside 1st Item. how can I add more items with diffrent elemnts in it. Like how can I insert into 4th item of sequence etc...Could you please demonstrate with an example?
-
- ICSMED DICOM Services
- Posts: 2217
- Joined: Fri, 2004-10-29, 21:38
- Location: Oldenburg, Germany
Here's an example from module "dcmsr":
For more details please consult the documentation of the method.
Code: Select all
/* create a new item (and a sequence if required) */
result = dataset.findOrCreateSequenceItem(DCM_ReferencedSOPSequence, item, -2 /*append new*/);
if (result.good())
{
/* store the instance level attributes */
item->putAndInsertOFStringArray(DCM_ReferencedSOPClassUID, instance->SOPClassUID);
item->putAndInsertOFStringArray(DCM_ReferencedSOPInstanceUID, instance->InstanceUID);
}
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 1 guest