How to get ROI of dicom file?

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
Han Jong Chul
Posts: 13
Joined: Thu, 2008-03-13, 06:59

How to get ROI of dicom file?

#1 Post by Han Jong Chul »

Hello, I've got a question.
I've justed extracted the image value of dicom file without header.

Is there any way to get ROI of dcm file??

For example, I've got a series of dicom files which sizes are 672*672.
But I want dicom files of 256*256, around center.

From the help menu, I found DJCodecParameter class and GetROI function.

Is it right to use it??

If it is, how to use it.

I decleared like this.

DJCodecParameter *QQ=new DJCodecParameter(AA);

But it doesn't work.

I' m quite new in using DCMTK;
Please help me.

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1444
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg »

ROI just means "region of interest" and can be used in many contexts. The method in class DJCodecParameter is absolutely not what you are looking for. What you need is DicomImage::createClippedImage().

Han Jong Chul
Posts: 13
Joined: Thu, 2008-03-13, 06:59

1 more question^^

#3 Post by Han Jong Chul »

m_strFileName.Format("DCT");
m_strFileName.Format(m_strFileName+"%3.4d",j);
m_strFileName.Format(m_strFileName+".dcm");

DicomImage *image = new DicomImage(m_strFileName);

image->createClippedImage(100,100,256,256,0);

XSize=image->getWidth();
YSize=image->getHeight();
Depth=image->getDepth();
if (image != NULL)
{
if (image->getStatus() == EIS_Normal)
{
Uint8 *pixelData = (Uint8 *)(image->getOutputData(8 /* bits per sample */));
if (pixelData != NULL)
{

for(int i=0;i<256*256;i++)
{
Data=0;
}

for(i=0;i<256*256;i++)
{
Data = pixelData;

}
}
}
}



I did like this.
But image is something wrong.
Can you tell me about problem??

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest