Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Enhanced multi-frame DICOM conversion to single file

6,804 views
Skip to first unread message

g...@umn.edu

unread,
Oct 5, 2013, 6:11:21 PM10/5/13
to
Has anyone successfully converted a multi-frame CT or MR enhanced DICOM object to a single multi-frame file? Thoughts?


Thanks in advance!

Greg--

--
Greg M. Silverman
Senior Developer Analyst
Cardiovascular Informatics
University of Minnesota

Mathieu Malaterre

unread,
Oct 6, 2013, 11:53:33 AM10/6/13
to
On Sunday, October 6, 2013 12:11:21 AM UTC+2, g...@umn.edu wrote:
> Has anyone successfully converted a multi-frame CT or MR enhanced DICOM object to a single multi-frame file? Thoughts?

I have had some success in the past using either gdcmtar (GDCM) and dcuncat (dicom3tools).

g...@umn.edu

unread,
Oct 6, 2013, 6:13:43 PM10/6/13
to
Thanks! I was just looking at the GDCM tools last night and not sure which, if any, would work. I guess tar makes sense! I'll give it a whirl.

Greg--

Michael Backhaus

unread,
Oct 7, 2013, 3:45:08 AM10/7/13
to
A tool for that is part of dcm4che 3.x:

$ ./emf2sf --help
usage: emf2sf [<options>] <dicom-file>

The emf2sf utility converts a DICOM Enhanced CT, MR or PET Multi-frame
image to legacy DICOM Single-frame CT, MR, PET images.
-
Options:
-f,--frame <no[,..]> comma separated numbers of frames to convert;
convert all frames by default
-h,--help display this help and exit
--inst-no <format> specifies instance number in created
Single-frame images as printf pattern. First %
will be replaced by the instance number of the
Enhanced Multi-frame image, second % by the
frame number (default: '%s%04d')
--not-chseries do not change Series Instance UID in created
Single-frame images
--out-dir <directory> directory to which extracted frames are stored
in DICOM files with file names specified by
option --out-file (default: '.')
--out-file <name> name of DICOM files of converted legacy DICOM
Single-frame images written to the directory
specified by out-dir. Zeros will be replaced
by the frame number (default:
<dicom-file>-000.dcm)
-V,--version output version information and exit
Example:
$ emf2sf -f 1,20,120 --out-file ct-000.dcm ct-emf.dcm
Extract frame 1, 20 and 120 from Enhanced CT Multi-frame image ct-emf.dcm
to legacy DICOM Single-frame CT images ct-001.dcm, ct-020.dcm and
ct-120.dcm.
Message has been deleted

g...@umn.edu

unread,
Oct 7, 2013, 3:54:13 PM10/7/13
to
Thanks! I looked at the dcm4che2 toolkit, but not version 3. One small problem though, is that I want all the frame in a single DICOM file, not each frame in its own file.

Greg--
Message has been deleted

David Clunie

unread,
Oct 8, 2013, 8:14:07 AM10/8/13
to
The dctoraw utility in dicom3tools will do this.

David

On 10/7/13 4:21 PM, g...@umn.edu wrote:
> I'm wondering if I am asking the wrong question: I need to convert a directory of DICOM files for CT/MR multi-frame objects into a single file that contains all the multi-frame data.
>
> From the utilities pointed out here, the opposite direction is given.
>
> I assume this is possible?
>
> Thanks!
>
> Greg--

Marcheschi

unread,
Oct 9, 2013, 5:24:56 AM10/9/13
to
Hi
If I understand your question, you want to create an
Enhanced MR/CT Multi-frame image
from a sequence of single image frames in dicom ?

that is more difficult and I didn't find myself an answer.
you can try:

"dcmulti" from dicom3tools

unfortunately this does not seem to work with my thousand MR images (FMRI GE Signa), but it creates a single DICOM file from hundreds images

You have to decompress images first.

I think that an utility such that it is very interesting in order to convert old archives in the new enhanced multiframe standard

Paolo
Message has been deleted

horcle_buzz

unread,
Oct 9, 2013, 2:00:53 PM10/9/13
to
Can you please give an example usage of this? I'm trying to get gdcmtar working (almost there), and it would be good to see how the two compare.

Thanks!

Greg--

Andrey Fedorov

unread,
Oct 28, 2013, 1:43:15 PM10/28/13
to
@horcle_buzz: were you able to figure this out with dicom3tools?

I am interested in the same task. Going back to the MultiVollumeExplorer module of 3D Slicer that I mentioned to you in another post, it would be nice to be able to "harmonize" 4d data of different types and vendors (3d + time or some other data feature, such as FA, TR or TE) into a single file multiframe DICOM datasets.

If you had any luck (and ideally if you could share some datasets), I would be interested to see what it will take to add support of such datasets into 3D Slicer.

horcle_buzz

unread,
Oct 28, 2013, 3:07:45 PM10/28/13
to
Hi Andrey,
Yes, dicom3tools works well for this. Assuming mr is a directory with image series files
dcmulti mr/* -verbose -sortby InstanceNumber -ascending >MFIMAGE

I'll see what I can do with getting test data to you.

Thanks!

Greg--

Andrey Fedorov

unread,
Oct 28, 2013, 4:20:36 PM10/28/13
to
Greg, thanks for the reply. Since you say it works, let me just try to coerce some of the data I have into that hyper-multi-frame shape.

horcle_buzz

unread,
Oct 30, 2013, 11:41:46 AM10/30/13
to
The switch was wrong: only seems to work with a -descending

Greg--

d4v3m0nk

unread,
Feb 18, 2015, 6:05:17 PM2/18/15
to
I appreciate that this thread may be here for more historical purposes, but I've got a multi-frame DICOM file that I've uncompressed, converted to single frames, obtained raw pixel data, resized the images and then converted back to individual DICOM files. I've tried on numerous occasions to then use "dcmulti" to take those single frame files and put them back into one multi-frame but it's not overly clear how to achieve this, even when reading the "man dcmulti".

I'm using "dcmulti -v 1-0*_1.dcm > MULTIFRAME.DCM"

MULTIFRAME.DCM gets created but is only 982 bytes in size, whereas each of the single frame DICOM files (1-001_1.dcm, 1-002_1.dcm) are 1040 bytes each.

I know Mr Clunie is clever, but I find it hard to believe that he's just THAT good!!

Any ideas?

David Clunie

unread,
Feb 18, 2015, 9:32:12 PM2/18/15
to
On 2/18/15 6:05 PM, d4v3m0nk wrote:

> I appreciate that this thread may be here for more historical purposes,
> but I've got a multi-frame DICOM file that I've uncompressed, converted
> to single frames, obtained raw pixel data, resized the images and then
> converted back to individual DICOM files. I've tried on numerous
> occasions to then use "dcmulti" to take those single frame files and
>put them back into one multi-frame but it's not overly clear how to
> achieve this, even when reading the "man dcmulti".
>
> I'm using "dcmulti -v 1-0*_1.dcm > MULTIFRAME.DCM"
>
> MULTIFRAME.DCM gets created but is only 982 bytes in size, whereas each
> of the single frame DICOM files (1-001_1.dcm, 1-002_1.dcm) are 1040
> bytes each.

Try the -of flag to specify the output file rather than piping stdout to
a file.

Note that dcmulti is really not a general purpose tool; it was originally
written just to concatenate frames, and then later tweaked for the
specific role of producing the test images for the NEMA MR (and later
CT) enhanced multi-frame project; it expects the input images to be in
precisely the right form to make a valid enhanced MR or CT output file,
and when the original input files were not, I copied them and added or
changed what was necessary to make dcmulti happy. It also spews lots
of warnings and errors that were useful to me but can often be
ignored.

I don't maintain it, so it probably no longer produces completely
valid output for some cases, as we have cleaned up the standard
a bit since those days.

An example of a Makefile for one of the files from that project is
included below, in case it helps (the Makefile.common.mk just
contains paths and nothing of interest).

That said, if you give it valid single frame images as input, it
should produce a multi-frame pixel data output regardless of the
validity of the rest of the attributes, so when you say your input
files are only 1040 bytes long, that doesn't sound right, since
that isn't enough to contain any meaningful pixel data, right?

Are your single frame images valid? What does dciodvfy say about
them?

David

--- start example Makefile ---
include Makefile.common.mk

DISCIMG/IMAGES/BRTUM001: Makefile.BRTUM001
mkdir -p ${TMPDIR}
rm -f ${TMPDIR}/*
for i in \
${SRCDIR}/braintumordiffusionspectro/488 \
${SRCDIR}/braintumordiffusionspectro/489 \
${SRCDIR}/braintumordiffusionspectro/490 \
${SRCDIR}/braintumordiffusionspectro/491 \
${SRCDIR}/braintumordiffusionspectro/492 \
${SRCDIR}/braintumordiffusionspectro/493 \
${SRCDIR}/braintumordiffusionspectro/494 \
${SRCDIR}/braintumordiffusionspectro/495 \
${SRCDIR}/braintumordiffusionspectro/496 \
${SRCDIR}/braintumordiffusionspectro/497 \
${SRCDIR}/braintumordiffusionspectro/498 \
${SRCDIR}/braintumordiffusionspectro/499 \
${SRCDIR}/braintumordiffusionspectro/500 \
${SRCDIR}/braintumordiffusionspectro/501 \
${SRCDIR}/braintumordiffusionspectro/502 \
; do ${DCCP} \
-stamp ${STAMP} \
-r PatientName "Brain^RFrontalTumorWSpectro" -r PatientID "MF-0000020" \
-r PatientSex "M" -r PatientBirthDate "19500704" \
-r PatientAge "052Y" \
-r PatientSize "1.6" -r PatientWeight "75" \
-r StudyID "05020" \
-r AccessionNumber "9995020" \
-r StudyDate "${RELEASEDATE}" \
-r SeriesDate "${RELEASEDATE}" \
-r ContentDate "${RELEASEDATE}" \
-r AcquisitionDate "${RELEASEDATE}" \
-r AcquisitionNumber "1" \
-r PerformingPhysicianName "Smith^John" \
-r ReferringPhysicianName "Thomas^Albert" \
-r NameOfPhysiciansReadingStudy "Smith^John" \
-r OperatorsName "Jones^Molly" \
-r InstitutionName "St. Nowhere Hospital" \
-r Manufacturer "Acme Medical Devices" \
-r ManufacturerModelName "Super Dooper Scanner" \
-r DeviceSerialNumber "123456" \
-r SoftwareVersions "1.00" \
-r StationName "CONSOLE01" \
-r BodyPartExamined "BRAIN" \
-r ImageType "ORIGINAL\\PRIMARY\\T1" \
-r AcquisitionContrast "T1" \
-r MagneticFieldStrength "1.5" \
-r ImagingFrequency "63.8755" \
-r EchoTrainLength 1 \
-d ImageComments \
-d InstanceCreationDate \
-d InstanceCreationTime \
-nodisclaimer \
"$$i" ${TMPDIR}/`basename "$$i"`; \
done
${DCMULTI} -of $@ \
-stamp ${STAMP} \
-nodisclaimer \
-removeinstanceuid \
-sortby ImagePositionPatient \
-derivedurationfromtiming \
-r StudyDescription "Brain" \
-r MultiPlanarExcitation "YES" \
-r SpecificCharacterSet "ISO_IR 100" \
-d BodyPartExamined \
-d PixelPaddingValue \
${TMPDIR}/*
rm -f ${TMPDIR}/*
--- end example Makefile ---

santos...@teleradtech.com

unread,
Mar 23, 2018, 2:44:25 AM3/23/18
to
Hi Sir,

Is there any suggestion or piece of code to Split DICOM multi-Frame Image.

Please help. and thanks in advance.








Jakub Sękowski

unread,
Aug 31, 2020, 8:59:31 AM8/31/20
to
Spliting a multi-frame dicom into a bunch of single-frame ones can be done using the tool dcuncat from dicom3tools toolkit. This command worked for me:

./dcuncat.exe -unenhance -instancenumber -of [output_prefix] [input_file]

The maintainer doesn't provide binary for this program, so it needs to be compiled from sources. The sources and very good compilation instructions can be found here: http://www.dclunie.com/dicom3tools.html
Spliting a multi-frame dicom into a bunch of single-frame ones can be done using the tool dcuncat from dicom3tools toolkit. This command worked for me:

./dcuncat.exe -unenhance -instancenumber -of [output_prefix] [input_file]

The maintainer doesn't provide binary for this program, so it needs to be compiled from sources. The sources and very good compilation instructions can be found here: http://www.dclunie.com/dicom3tools.html

0 new messages