Thanks in advance
Regards
Mahesh
if you want DICOM as output format, you could use DCMTK's dcmcjpeg and dcmdjpeg
tools - use dcmcjpeg to apply lossless JPEG compression while forcing the output
bit depth to 8 (dcmcjpeg --bits-force-8) and decompress the result using dcmdjpeg.
This certainly is a "kludge" but should do the job. The dcmcjpeg tool also provides
various command line options that control the conversion process (i.e., application
of a window level/width or VOI transformation prior to downscaling).
If you want JPEG, TIFF, PNM, PNG or the like, use DCMTK' dcmj2pnm tool, which
is intended exactly for that purpose and also provides a wealth of command line
options to control the conversion process.
Best regards,
Marco Eichelberg
OFFIS
Thanks replying;
I had try dcmcjpeg and dcmdjpeg but the
resultant picture was not clear. Actually my requirement is I have to
convert dicom image to J2k (without dicom tag) I am accomplishing this
task by compressing image in jpeg lossy format and extracting pixel
data from it. For 8 bit image and color image it is working fine
(because no ww and wc is applicable). but for 16 bit image the viewer
is showing incorect image (because window width and window center
information is lost)
Please help me
Then I would suggest you use dcmj2pnm, export to a lossless format such as
TIFF, BMP or PNG and convert to JPEG 2000 from there, using JasPer for example.
> For 8 bit image and color image it is working fine
> (because no ww and wc is applicable). but for 16 bit image the viewer
> is showing incorect image (because window width and window center
> information is lost)
For 16 bit images, you have to select the wc/ww range **before** converting
to 8 bit - dcmj2pnm has a couple of command line options for this purpose:
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
Which option with which parameters of course depends on the image type,
body part etc. To get started, --min-max-window or --histogram-window 5
are not so bad in many cases.
Best regards,
Marco Eichelberg
gdcmconv --j2k input.dcm output.dcm
You can then extract the pixel data using gdcmraw.
Ref:
http://apps.sourceforge.net/mediawiki/gdcm/index.php?title=Gdcmconv
HTH
Thank you all for your precious guideline
I had successfully solve the problem
Regards
Mahesh