I'm new to DCMTK, apologizes if I missed this in the FAQ or docs I could find.
I am trying to convert the DICOM images found here (the first of a set of 23 disks):
http://mystory.kpaddock.com/KarenMedica ... spital.zip
[These images are of my late wife, they are becoming part of a documentary,
there are no privacy issues to be concerned with.]
To JPEGs or PNGs. So far all I get from running dcm(j)2pnm is a black background.
Sometimes I get a small centered white square on the black background, for any images I've tried so far.
Example input image with -v -im gives:
I: reading DICOM file: ../000
I: preparing pixel data
I: dumping image parameters
I: filename : ../000
I: transfer syntax : Little Endian Explicit
I: SOP class : MRImageStorage
I: SOP instance UID : 1.3.46.670589.11.8963.9.1632031800000215640201.1.1.1.1.0.0.1
I: columns x rows : 256 x 256
I: bits per sample : 16
I: color model : MONOCHROME2
I: pixel aspect ratio : 1.00
I: number of frames : 1
I: VOI LUT function : <default>
I: VOI windows in file : 1
I: - <no explanation>
I: VOI LUTs in file : 0
I: presentation shape : <default>
I: overlays in file : 0
I: maximum pixel value : 1742
I: minimum pixel value : 0
I: disabling VOI window computation
I: writing frame 1 to stdout
P5
256 256
255
I'm ruining version DCMTK 3.6.0 on Gentoo Linux.
Would someone be kind enough to point me in a direction to get something useful, please?
dcm(j)2pnm small square with black background?
Moderator: Moderator Team
-
- DCMTK Developer
- Posts: 2501
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: dcm(j)2pnm small square with black background?
Your image has 16 bits per sample, i.e. 65536 shades of gray, but only 1743 of them are actually used. So, you should either select the stored VOI (Value of Interest) window by adding option "+Wi 1" or choose an automatically determined min-max VOI window by using option "+Wm".
Re: dcm(j)2pnm small square with black background?
Thank you. Adding the +Wm got me what I needed.
The one things I'm still missing is how to get the overlay text on an image or layer?
The one things I'm still missing is how to get the overlay text on an image or layer?
-
- DCMTK Developer
- Posts: 2501
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: dcm(j)2pnm small square with black background?
If you refer to Overlay Planes stored in the DICOM image: they are displayed by default. See the following overlay-related options:
If this is not what you mean by "overlay text", then it is not supported by dcm[j]2pnm.
Code: Select all
overlay:
-O --no-overlays do not display overlays
+O --display-overlay [n]umber: integer
display overlay n (0..16, 0=all, default: +O 0)
+Omr --ovl-replace use overlay mode "Replace"
(default for Graphic overlays)
+Omt --ovl-threshold use overlay mode "Threshold Replace"
+Omc --ovl-complement use overlay mode "Complement"
+Omv --ovl-invert use overlay mode "Invert Bitmap"
+Omi --ovl-roi use overlay mode "Region of Interest"
(default for ROI overlays)
+Osf --set-foreground [d]ensity: float
set overlay foreground density (0..1, def: 1)
+Ost --set-threshold [d]ensity: float
set overlay threshold density (0..1, def: 0.5)
Re: dcm(j)2pnm small square with black background?
In my lack of experience with DICOM formats I may be using the wrong term.J. Riesmeier wrote:If you refer to Overlay Planes stored in the DICOM image: they are displayed by default. See the following overlay-related options:
If this is not what you mean by "overlay text", then it is not supported by dcm[j]2pnm.
What I'm trying to emulate is the appearance of an old DOS program.
In that old DOS program there is text in white on the images that states such things as the patient's name, the place where the scan was done, the doctor that ordered the study etc.
With a binary dump I see the ASCII text and dcm2xml also extracts the text that is appearing on the image.
Perhaps getting that text on the image display was a function of the DOS program and not a function of the DICOM image format?
Is there a way to do that with DCMTK?
From dcm2xml:
# Dicom-Data-Set
# Used TransferSyntax: Little Endian Explicit
(0008,0005) CS [ISO_IR 100] # 10, 1 SpecificCharacterSet
(0008,0008) CS [ORIGINAL\PRIMARY\M_SE\M\SE] # 26, 5 ImageType
(0008,0012) DA [20120522] # 8, 1 InstanceCreationDate
(0008,0013) TM [162034] # 6, 1 InstanceCreationTime
(0008,0014) UI [1.3.46.670589.11.8963.5] # 24, 1 InstanceCreatorUID
(0008,0016) UI =MRImageStorage # 26, 1 SOPClassUID
(0008,0018) UI [1.3.46.670589.11.8963.9.1632031800000215640301.1.1.1.1.0.0.1] # 60, 1 SOPInstanceUID
(0008,0020) DA [20120522] # 8, 1 StudyDate
(0008,0021) DA [20120522] # 8, 1 SeriesDate
(0008,0023) DA [20120522] # 8, 1 ContentDate
(0008,0030) TM [154637.0000] # 12, 1 StudyTime
(0008,0031) TM [161629.66] # 10, 1 SeriesTime
(0008,0033) TM [161629.66] # 10, 1 ContentTime
(0008,0050) SH [29825620000100] # 14, 1 AccessionNumber
(0008,0060) CS [MR] # 2, 1 Modality
(0008,0070) LO [Philips Medical Systems] # 24, 1 Manufacturer
(0008,0080) LO [xyz xyz] # 16, 1 InstitutionName
(0008,0090) PN [xyz^xyz] # 12, 1 ReferringPhysicianName
(0008,1010) SH [NTSCAN] # 6, 1 StationName
(0008,1030) LO [MRI BRAIN W/WO] # 14, 1 StudyDescription
(0008,103e) LO [BRAIN T2W/TSE/TRA] # 22, 1 SeriesDescription
(0008,1050) PN (no value available) # 0, 0 PerformingPhysicianName
(0008,1080) LO (no value available) # 0, 0 AdmittingDiagnosesDescription
(0008,1090) LO [Intera] # 6, 1 ManufacturerModelName
(0008,1140) SQ (Sequence with undefined length #=3) # u/l, 1 ReferencedImageSequence
-
- DCMTK Developer
- Posts: 2501
- Joined: Tue, 2011-05-03, 14:38
- Location: Oldenburg, Germany
- Contact:
Re: dcm(j)2pnm small square with black background?
Right.Perhaps getting that text on the image display was a function of the DOS program and not a function of the DICOM image format?
There is no ready-to-use function in the DCMTK but this feature request is on our to-do list for some years: https://support.dcmtk.org/redmine/issues/214Is there a way to do that with DCMTK?
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest