Martin. Thanks a lot! This is very helpful
________________________________________
From: FSL - FMRIB's Software Library [[log in to unmask]] on behalf of Martin Dyrba [[log in to unmask]]
Sent: Wednesday, October 15, 2014 4:15 AM
To: [log in to unmask]
Subject: Re: [FSL] Decode JPEG-compressed DICOM file
Hi,
which information do you need exactly? Did you install DCMTK already?
You can check whether it is working in Linux:
locate dcmdjpeg
echo $DCMDICTPATH
Those commands display the location of the dcmdjpeg program and display the content of the environment variable DCMDICTPATH that is needed for dcmdjpeg.
Then you just have to call dcmdjpeg with the input and output dicom file:
dcmdjpeg input.dcm output.dcm
as documented here: http://support.dcmtk.org/docs-dcmrt/dcmdjpeg.html
You should not need to set additional parameters (mainly MRIs use gray channel, not color channels).
I personally use a scripted version, e.g. a bash script:
==== cut here ====
#!/bin/bash
# define input and output dirs
INPUT_DIR="/some/dir/where/the/dicoms/are/stored"
OUTPUT_DIR="$INPUT_DIR/decompressed_dicoms"
# create output dir
mkdir -p "$OUTPUT_DIR"
# call dcmdjpeg with each file in input dir
for i in $(find "$INPUT_DIR" -name '*.dcm'); do
# if the dicom files do not have the extension .dcm use instead: for i in $(find "$INPUT_DIR" -type f); do
FILENAME="${i#$INPUT_DIR/}"
FILEPARENT="${FILENAME%/*}"
if [[ "$FILEPARENT" != "$FILENAME" -a -n "$FILEPARENT" ]]; then
# create new parent folders if needed
mkdir -p "$FILEPARENT"
fi
dcmdjpeg "$i" "$OUTPUT_DIR/$FILENAME"
done
==== cut here ====
The script could be extended to use the first argument as input dir or to treat file/dir arguments differently...
Best regards,
Martin
The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
|