Get and manipulate pixels of Dicom Image - DICOM
This is a discussion on Get and manipulate pixels of Dicom Image - DICOM ; Hello, I try to get the pixels of Dicom Image using code I have finded
here but I don't understand the way values of pixels are got, and how
manipulate them so that I can create a new dicom file ...
-
Get and manipulate pixels of Dicom Image
Hello, I try to get the pixels of Dicom Image using code I have finded
here but I don't understand the way values of pixels are got, and how
manipulate them so that I can create a new dicom file with the
modified image using different tags.
this is my code :
DcmFileFormat fileformat;
OFCondition status = fileformat.loadFile("c:\\image.dcm");
if (status.good())
{
DcmDataset *dataset = fileformat.getDataset();
int length;
length = rows * cols ; //get
with tags
short* pixels = (short *) malloc(length * 2);
Uint16 * p = NULL;
short * pixelPtr = pixels;
status = dataset->findAndGetUint16Array(DCM_PixelData, p);
for(int i = 0; i < length; i++) *(pixelPtr++) = *(p++);
}
Now I want to modify value of pixels, can you give me an example ? is
it the same way to get pixels values with RGB image (only tags change
samples per pixel...).
Please, give me some examples to manipulate the pixels values and send
these new values in the new dataset of another dicom file!
sylvain
-
Re: Get and manipulate pixels of Dicom Image
hi sylvain
i am also working on DICOM. i don't know abt your question but i have a
problem like that of yours. if you could help me in that respect. i
want to compare bmp image format with that of DICOM image format that
would be obviously in terms of pixels etc. do you know how to get
information about DICOM image format.
thanx