[Insight-users] Need some advise with DICOM

Mathieu Malaterre mathieu.malaterre at gmail.com
Sun Mar 25 11:53:00 EST 2007


Hi Markus,

On 3/25/07, Markus Weigert <m.weigert at fz-juelich.de> wrote:
> Hi all,
>
> I need some advise with writing a dicom serie.
> When doing this without explicitly changing any information in the
> MetaDataDictionary, the information there is changed neverthless.
> This seems to cause problems in the later processing steps of the output.
> My problem is that the tag "Bits Allocated / Stored / High Bit" which is "16 /
> 12 / 11" in the original images is changed to "16 / 16 / 15" and also the tag
> "Offset to Pixeldata" changes from 6738 to 2228.

ok

> For me, this may be crucial since I do some manipulation to the imagedata and
> want to transfer it back to the acquisition scanner, where I perform some
> image reconstruction steps on the new data which has the dicom information of
> the original slices (what is wrong since the data representation has
> changed).

I don't see the problem here. In fact it seems to me that the output
of gdcm is definitely easier to read for you (faster processing),
since you are garantee there is nothing padded before the pixel data.
Keep in mind that nothing in DICOM will garantee for a 16/12/11 that
the first few bits will be zero (0). Whereas when you read a 16/16/15
then yes you are garantee that you can read the pixel data with a
simple fread (no masking is needed).


> The question is now: Why does the gdcm output change the bit
> representation of the original slices and how to avoid this?

You can't (*). IMHO it is easier for everybody this way. Please
describe why a fread+masking is required in your case.

> The internal representation of the images is float but for DICOM output I cast
> it to short and apply rescale slope and rescale intercept values.

ok

> By the way: Does anybody know about a kind of Dicom-Dump tool which can be
> used to make one to one copies of a dicom series but changing pixeldata for
> example?

You would need to use gdcm directly (without the ITK-gdcm layer).

-- 
Mathieu
(*) well you can technically but not using the ITK-gdcm layer, instead
you would need to write code using the gdcm API directly.


More information about the Insight-users mailing list