Invert Image

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
focus
Posts: 77
Joined: Wed, 2005-03-16, 20:29
Location: Catalonia

Invert Image

#1 Post by focus »

I have scaled a image with dcmscale, but the problem is that the original DICOM is visualitzated, appears inverted the left and the right, in other words the left side appears in the right, and the right side in the left. The correct way to visualitzate the image is like do the dicom visualitzator, that inverts the image

Is there any function that allows me to invert the image ?
And another thing there is any other function that allows me to change the contrat image ? Thanks!

focus
Posts: 77
Joined: Wed, 2005-03-16, 20:29
Location: Catalonia

#2 Post by focus »

Excuseme I have found flip option, in dcm2pnm I will study the code of this program, to flip the images.

But I hasn't found any function to change the contrast, exists it in dcmtk ?

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#3 Post by Jörg Riesmeier »

I'm not sure whether you want to create a new DICOM object or a rendered image file (e.g. PGM, BMP or TIFF). If the latter is the case, you could use dcm2pnm with option --change-polarity (+P) in order to invert the pixel data.

focus
Posts: 77
Joined: Wed, 2005-03-16, 20:29
Location: Catalonia

#4 Post by focus »

I render a PGM image file, the problem is that I scaled the images to 100 pixels, and with MR dicoms the images are so dark, that when I scale it, it's difficut to see the Image correctly because it's too dark, and I need to increase the contrast or the brigthness, I have try to invert the polarity, but the background where I present the scaled image is white, and i'ts difficult to appreciate the image,

I need something to change the contrast or the brightness! Can I do this with dcmtk? In other case I will use a graphic library

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#5 Post by Jörg Riesmeier »

There are a couple of command line options in dcm2pnm that can be used for this purpose:

Code: Select all

  VOI LUT transformation:
    -W    --no-windowing        no VOI windowing (default)
    +Wi   --use-window          [n]umber : integer
                                use the n-th VOI window from image file
    +Wl   --use-voi-lut         [n]umber : integer
                                use the n-th VOI look up table from image file
    +Wm   --min-max-window      compute VOI window using min-max algorithm
    +Wn   --min-max-window-n    compute VOI window using min-max algorithm,
                                ignoring extreme values
    +Wr   --roi-min-max-window  [l]eft [t]op [w]idth [h]eight : integer
                                compute ROI window using min-max algorithm,
                                region of interest is specified by l,t,w,h
    +Wh   --histogram-window    [n]umber : integer
                                compute VOI window using Histogram algorithm,
                                ignoring n percent
    +Ww   --set-window          [c]enter [w]idth : float
                                compute VOI window using center c and width w
You could e.g. try option --min-max-window (+Wm).

focus
Posts: 77
Joined: Wed, 2005-03-16, 20:29
Location: Catalonia

#6 Post by focus »

Thanks for your help! this is what exactly I was searching

Post Reply

Who is online

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