Trouble using DCMTK's dcmmkdir to create a DICOMDIR - DICOM

This is a discussion on Trouble using DCMTK's dcmmkdir to create a DICOMDIR - DICOM ; Hi guys, Apologies in advance if this is a question you get a lot (I had a quick look to see if I could find a FAQ, but no luck), but I've been trying to create a DICOMDIR file with ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Trouble using DCMTK's dcmmkdir to create a DICOMDIR

  1. Trouble using DCMTK's dcmmkdir to create a DICOMDIR

    Hi guys,

    Apologies in advance if this is a question you get a lot (I had a quick
    look to see if I could find a FAQ, but no luck), but I've been trying to
    create a DICOMDIR file with dcmmkdir (from DCMTK -
    http://dicom.offis.de/dcmtk) and I've run into problems; was just
    wondering if anyone could prod me in the right direction please?

    The problem I'm actually seeing is an error message from Centricity
    DICOM Viewer 2.2, which says "Selected DICOMDIR not supported". It works
    fine with the DICOMDIR files supplied with my data, but not with the one
    I just tried to create (so it's probably my fault...)

    The reason I want to do this at all is that some of my series have been
    split across multiple CDs and renamed - it's a pain to work with
    programmatically (the data in the images hasn't changed, it's just the
    filenames which have, e.g. image 264 might be the first image from a
    series on a given disk and end up being called IM1). I want to shove all
    the images from a series into one directory, then recreate an overall
    DICOMDIR file for all the images I've got.

    I wrote a program which reads all the existing DICOMDIR files, gets the
    real instance number from the image headers and copies the files across
    to a new directory structure with the correct names. That seems to work
    fine (as far as I can tell at this stage). The problem occurs when
    trying to actually create the DICOMDIR using:

    dcmmkdir +r +I +m *.*

    (the +I and +m are because the images seem to be missing a StudyID value
    and because the patient names are lowercase, respectively).

    It doesn't seem to be a problem specifically with the Centricity viewer
    - I tried loading the DICOMDIR file in using my program and it seems
    that the series names (at least) haven't been copied across - there's
    something a bit dodgy about the file that's being output.

    Any thoughts at all please? I'm no DICOM expert having only just started
    working with the images relatively recently, so I'm a bit stumped...

    Cheers,
    Stuart

  2. Re: Trouble using DCMTK's dcmmkdir to create a DICOMDIR

    Stuart,

    > It doesn't seem to be a problem specifically with the Centricity viewer
    > - I tried loading the DICOMDIR file in using my program and it seems
    > that the series names (at least) haven't been copied across - there's
    > something a bit dodgy about the file that's being output.


    do you mean that the Series Description is missing in the DICOMDIR?
    In this case read: http://forum.dcmtk.org/viewtopic.php?t=1573

    Here's the relevant paragraph:

    "Series Description is an optional attribute in the DICOMDIR, as it is in
    the Series Module which is included by most DICOM objects (IODs). So
    dcmmkdir does not write it per default and there is no option to enable
    this. You would have to change the source code to have that attribute in
    the DICOMDIR."

    Regards,
    Joerg Riesmeier

  3. Re: Trouble using DCMTK's dcmmkdir to create a DICOMDIR

    Hi Stuart

    Have you tried running the DICOMDIR that you created through a
    validator (like my dciodvfy) ? It will probably tell you if
    there is anything formally wrong with it (regardless of whether
    Centricity will read it or not).

    There is also a dcdirmk utility in my dicom3tools, which might be
    worth a try if you really can't get dcmmkdir to work, and also
    a com.pixelmed.dicom.DicomDirectory class in PixelMed.

    I assume that all the files and folders that you are feeding in
    have no filename extensions, are no more than 8 characters, are
    uppercase, digits and underscore only, etc., otherwise by
    definition you have an illegal fileset and will create an
    illegal DICOMDIR.

    David

    Stuart Golodetz wrote:
    > Hi guys,
    >
    > Apologies in advance if this is a question you get a lot (I had a quick
    > look to see if I could find a FAQ, but no luck), but I've been trying to
    > create a DICOMDIR file with dcmmkdir (from DCMTK -
    > http://dicom.offis.de/dcmtk) and I've run into problems; was just
    > wondering if anyone could prod me in the right direction please?
    >
    > The problem I'm actually seeing is an error message from Centricity
    > DICOM Viewer 2.2, which says "Selected DICOMDIR not supported". It works
    > fine with the DICOMDIR files supplied with my data, but not with the one
    > I just tried to create (so it's probably my fault...)
    >
    > The reason I want to do this at all is that some of my series have been
    > split across multiple CDs and renamed - it's a pain to work with
    > programmatically (the data in the images hasn't changed, it's just the
    > filenames which have, e.g. image 264 might be the first image from a
    > series on a given disk and end up being called IM1). I want to shove all
    > the images from a series into one directory, then recreate an overall
    > DICOMDIR file for all the images I've got.
    >
    > I wrote a program which reads all the existing DICOMDIR files, gets the
    > real instance number from the image headers and copies the files across
    > to a new directory structure with the correct names. That seems to work
    > fine (as far as I can tell at this stage). The problem occurs when
    > trying to actually create the DICOMDIR using:
    >
    > dcmmkdir +r +I +m *.*
    >
    > (the +I and +m are because the images seem to be missing a StudyID value
    > and because the patient names are lowercase, respectively).
    >
    > It doesn't seem to be a problem specifically with the Centricity viewer
    > - I tried loading the DICOMDIR file in using my program and it seems
    > that the series names (at least) haven't been copied across - there's
    > something a bit dodgy about the file that's being output.
    >
    > Any thoughts at all please? I'm no DICOM expert having only just started
    > working with the images relatively recently, so I'm a bit stumped...
    >
    > Cheers,
    > Stuart


  4. Re: Trouble using DCMTK's dcmmkdir to create a DICOMDIR

    > Stuart Golodetz wrote:
    >> Hi guys,
    >>
    >> Apologies in advance if this is a question you get a lot (I had a
    >> quick look to see if I could find a FAQ, but no luck), but I've been
    >> trying to create a DICOMDIR file with dcmmkdir (from DCMTK -
    >> http://dicom.offis.de/dcmtk) and I've run into problems; was just
    >> wondering if anyone could prod me in the right direction please?
    >>
    >> The problem I'm actually seeing is an error message from Centricity
    >> DICOM Viewer 2.2, which says "Selected DICOMDIR not supported". It
    >> works fine with the DICOMDIR files supplied with my data, but not with
    >> the one I just tried to create (so it's probably my fault...)
    >>
    >> The reason I want to do this at all is that some of my series have
    >> been split across multiple CDs and renamed - it's a pain to work with
    >> programmatically (the data in the images hasn't changed, it's just the
    >> filenames which have, e.g. image 264 might be the first image from a
    >> series on a given disk and end up being called IM1). I want to shove
    >> all the images from a series into one directory, then recreate an
    >> overall DICOMDIR file for all the images I've got.
    >>
    >> I wrote a program which reads all the existing DICOMDIR files, gets
    >> the real instance number from the image headers and copies the files
    >> across to a new directory structure with the correct names. That seems
    >> to work fine (as far as I can tell at this stage). The problem occurs
    >> when trying to actually create the DICOMDIR using:
    >>
    >> dcmmkdir +r +I +m *.*
    >>
    >> (the +I and +m are because the images seem to be missing a StudyID
    >> value and because the patient names are lowercase, respectively).
    >>
    >> It doesn't seem to be a problem specifically with the Centricity
    >> viewer - I tried loading the DICOMDIR file in using my program and it
    >> seems that the series names (at least) haven't been copied across -
    >> there's something a bit dodgy about the file that's being output.
    >>
    >> Any thoughts at all please? I'm no DICOM expert having only just
    >> started working with the images relatively recently, so I'm a bit
    >> stumped...
    >>
    >> Cheers,
    >> Stuart


    David Clunie wrote:
    > Hi Stuart
    >
    > Have you tried running the DICOMDIR that you created through a
    > validator (like my dciodvfy) ? It will probably tell you if
    > there is anything formally wrong with it (regardless of whether
    > Centricity will read it or not).
    >
    > There is also a dcdirmk utility in my dicom3tools, which might be
    > worth a try if you really can't get dcmmkdir to work, and also
    > a com.pixelmed.dicom.DicomDirectory class in PixelMed.
    >
    > I assume that all the files and folders that you are feeding in
    > have no filename extensions, are no more than 8 characters, are
    > uppercase, digits and underscore only, etc., otherwise by
    > definition you have an illegal fileset and will create an
    > illegal DICOMDIR.
    >
    > David


    Hi David,

    Thanks. It seems it might be a Centricity thing since the free Santesoft
    reader (which I found this morning) reads it fine. I didn't realise
    there was a validator; I'll try it to make sure. Shame dcmmkdir doesn't
    keep things like SeriesDescription. Do you know whether dcdirmk or the
    PixelMed class do things any differently by any chance?

    I had some initial issues with filenames not being capitalised, but it
    warned me about those and I sorted them out. The only other warnings I
    got were to do with missing study IDs - it invented some for me instead,
    so I guess that shouldn't have been the problem?

    Regards,
    Stuart

  5. Re: Trouble using DCMTK's dcmmkdir to create a DICOMDIR

    Joerg Riesmeier wrote:
    > Stuart,
    >
    >> It doesn't seem to be a problem specifically with the Centricity
    >> viewer - I tried loading the DICOMDIR file in using my program and it
    >> seems that the series names (at least) haven't been copied across -
    >> there's something a bit dodgy about the file that's being output.

    >
    > do you mean that the Series Description is missing in the DICOMDIR?
    > In this case read: http://forum.dcmtk.org/viewtopic.php?t=1573
    >
    > Here's the relevant paragraph:
    >
    > "Series Description is an optional attribute in the DICOMDIR, as it is in
    > the Series Module which is included by most DICOM objects (IODs). So
    > dcmmkdir does not write it per default and there is no option to enable
    > this. You would have to change the source code to have that attribute in
    > the DICOMDIR."
    >
    > Regards,
    > Joerg Riesmeier


    Hi Joerg,

    Thanks - I may have to make do without it in that case. Seems a bit
    strange that it would be optional, I'd have thought it was quite a
    useful bit of information. Oh well!

    Cheers,
    Stuart

+ Reply to Thread