[Insight-users] Problem in copying DICOM image: Study instance UID value is changed

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Jul 3 05:03:25 EDT 2008


Subrahmanyam,

On Wed, Jul 2, 2008 at 9:44 PM, Subrahmanyam Gorthi
<subrahmanyam.gorthi at gmail.com> wrote:
> Dear Mathieu,
>
> Thank you very much for your reply.
>
>>> Is this integrated with any of the Mesh and/or the Meta Object in ITK too
>>> ?
>
> Currently, at the end of my segmentation in ITK, I have ROIs in mask format.
> I still have to work on converting this mask to a polygon so that in can be
> written to a ROI module.

If this is 2D ROIs mask, simply use marching cube to generated the
contour. This will be very fast and very robust.

> Because of my little exposure to ITK, I am not aware whether this conversion
> involves Mesh or Meta Objects.

Forget what I said about Spatial objects, those are not meant for
this. I think most segmentation algorithm will return an itk::Mesh.
Using itk::Mesh should be fine.

> I am facing problem while calling the KeepOriginalUIDOn ().
> A runtime exception is thrown when the above function is called.
> I am afraid there is some error in the way I am using the ImageFileWriter,
> since the error is occurring while updating the writer.
> To reproduce the problem, I have created a sample code.
> Please find attached the .cxx & the associated CMakeLists.txt files.
> Can you please help me?

You cannot do this:

...
  ImageType::Pointer dummyImage = ImageType::New();

  writer->SetFileName( outputFileName );
  writer->SetInput( dummyImage );

  writer->SetImageIO( gdcmImageIO );
...

  your image: has no dimension, is not allocated, and is not
initialized. If you compiler previously allowed you to write such an
image, well... it's *really* a broken compiler.



> Thank you for the details on the possible pipeline for the RTSTRUCT, which
> is more flexible and general.
> I will give a try part by part.

As a side note you cannot do that either:

  string tagValue = "0.0.0.0.2.8811.20010413115754.12432";

"0.0.0.0" is not a valid root UID. Did you use dicom3tools at any
point in the process ? If so please check the README file in the
source tree, explaining how to compile it and set your own root UID.

HTH
-- 
Mathieu


More information about the Insight-users mailing list