[Insight-users] Reading DICOM series: ByteSwapping
Luis Ibanez
luis.ibanez@kitware.com
Mon, 21 Apr 2003 22:15:15 -0400
Hi Jolinda,
Thanks for making your MRIConverter program available.
It is working great !.
--
About the addition of byte swapping for supporting
multiple platforms; there is helper class in ITK that
you may want to use for performing this task.
It is in the directory: "Insight/Code/Common"
itkByteSwapper.h
itkByteSwapper.txx
http://www.itk.org/Insight/Doxygen/html/classitk_1_1ByteSwapper.html
This is not rocket science, but it is certainly painful
code that you may not want to write and debug if you don't
have to.
The itk::ByteSwapper is currently used by all the ITK ImageIO
objects, so it is fairly well tested in the range of platforms
that you can see in the Dashboard.
In case MRIConverter is not using ITK internally, you
may simply copy-paste code from this class into your
application. The class is now deriving from itk::Object,
but there is not fundamental reason why it should do so.
You couuld remove the code related to smart pointers
and then eliminate the itk::Object as base class.
---
You may find interesting also to look at the implementation
of the DICOM parser in ITK (as far as the byte swapping goes).
It is located in Insight/Utilities/DICOMParser.
Regards,
Luis
--------------------
Jolinda Smith wrote:
>>It would help us if you could make a linux version, as well.
>>
>> -- krs
>>
>
>
> I want to do this (and a Mac port) if enough people request it. There
> isn't much platform-dependent code involved; I just need to put some
> byte-swapping routines into the DICOM reading code.
>
> My fantasy is to go back in time and force everyone to use the same
> byte-ordering scheme. Things would be sooo much simpler.
>
> Jolinda Smith
> Lewis Center for NeuroImaging
> University of Oregon
> jolinda@uoregon.edu
>
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>