[ITK-users] Extensions to the MetaImage (MHDs) IO-plugin to support compression and MHAs

Curtis Rueden ctrueden at wisc.edu
Mon Aug 4 15:35:38 EDT 2014


Hi Roman,

> I've extended the MetaImage (used by e.g. ITK/VTK)  IO-plugin from
> Kang Li (http://www.kangli.org/code/MetaImage_Reader_Writer.html) to
> also support compression and local data storage, i.e. MHAs. The
> MetaImage Reader/Writer from
> (http://ij-plugins.sourceforge.net/plugins/3d-io/) seems not to
> support this either. Reading and writing in Fiji was tested with MHDs
> and MHAs created/read by ITK-4.5.1. While the plugin handles files
> bigger than 4GB correctly, (for unknown reasons my) ITK seems to have
> problems with MHDs/MHAs bigger than 4GB (in general).

Interesting work. If you would like to get it upstream into Fiji, I suggest
filing a Pull Request [1] against the IO repository [2].

Please also be aware that ImageJ is moving away from HandleExtraFileTypes
hacks in favor of a unified Java library for image I/O known as SCIFIO [3].
There is already a SCIFIO/ITK bridge project [4, 5] that allows reading and
writing SCIFIO formats within ITK.

Regards,
Curtis

[1] https://help.github.com/articles/using-pull-requests
[2] https://github.com/fiji/IO
[3] http://imagej.net/SCIFIO
[4] https://github.com/scifio/scifio-imageio
[5] https://github.com/scifio/scifio-itk-bridge


On Mon, Jul 28, 2014 at 12:34 PM, Williams, Norman K <
norman-k-williams at uiowa.edu> wrote:

> This is a good thing to submit to ITK proper; it would require conversion
> to C++, though.
>
> On 7/28/14, 9:23 AM, "Dr. Roman Grothausmann"
> <grothausmann.roman at mh-hannover.de> wrote:
>
> >Dear mailing list members,
> >
> >
> >I've extended the MetaImage (used by e.g. ITK/VTK)  IO-plugin from Kang
> >Li
> >(http://www.kangli.org/code/MetaImage_Reader_Writer.html) to also support
> >compression and local data storage, i.e. MHAs. The MetaImage
> >Reader/Writer from
> >(http://ij-plugins.sourceforge.net/plugins/3d-io/) seems not to support
> >this
> >either.
> >Reading and writing in Fiji was tested with MHDs and MHAs created/read by
> >ITK-4.5.1. While the plugin handles files bigger than 4GB correctly, (for
> >unknown reasons my) ITK seems to have problems with MHDs/MHAs bigger than
> >4GB
> >(in general).
> >The plugin does not check whether the size of the compressed data is
> >correct,
> >ITK however does. If the header lacks an entry of CompressedDataSize, ITK
> >throws
> >an error when reading/loading such a file. If the size specified with
> >CompressedDataSize is too big, ITK just issues a warning. This was used
> >as a
> >workaround because I did not find an easy way in Java to put the correct
> >value
> >for CompressedDataSize without using extra temporary files (which might
> >be quite
> >big).
> >
> >Attached are the modified files (java-files, plugins.config and a
> >repacked
> >IO_-2.0.0-SNAPSHOT.jar).
> >A modified HandleExtraFileTypes.java (based on:
> >https://github.com/fiji/IO/blob/master/src/main/java/HandleExtraFileTypes
> .
> >java)
> >is also included.
> >Togehter with the modified Plugin it allows opening MHDs and MHAs
> >directly.
> >
> >
> >The repacked IO_-2.0.0-SNAPSHOT.jar was generated with:
> >
> >javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. MetaImage_Reader.java
> >javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. MetaImage_Writer.java
> >javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. MetaImage_CWriter.java
> >
> >javac -cp /opt/fiji/Fiji.app/jars/ij-1.48a.jar:. HandleExtraFileTypes.java
> >
> >The compiled Class-files were moved to a subfolder named io/:
> >ExtendedFileOpener.class  MetaImage_CWriter.class  MetaImage_Writer.class
> >ExtendedFileSaver.class   MetaImage_Reader.class
> >ReplacingInputStream.class
> >
> >And then included/replaced with zip:
> >zip -r IO_-2.0.0-SNAPSHOT.jar plugins.config HandleExtraFileTypes.class
> >io/
> >
> >Feel free to add these extensions to the Plugin-Page or the ImageJ/Fiji
> >repository.
> >Any suggestions concerning improvements are very welcome.
> >
> >
> >Many thanks for ImageJ/Fiji and the initial Metaimage IO-plugin.
> >Roman
> >
> >
> >--
> >Dr. Roman Grothausmann
> >
> >Tomographie und Digitale Bildverarbeitung
> >Tomography and Digital Image Analysis
> >
> >Institut für Funktionelle und Angewandte Anatomie, OE 4120
> >Medizinische Hochschule Hannover
> >Carl-Neuberg-Str. 1
> >D-30625 Hannover
> >
> >Tel. +49 511 532-9574
> >
> >
> >
> >======================================================================
> >A potentially unsafe attachment has been removed from this email
> >message. See http://its.uiowa.edu/support/article/100806 for further
> >information.
> >
> >Removed attachment name(s):
> >IO_-2.0.0-SNAPSHOT.jar
> >======================================================================
> >
>
>
>
> ________________________________
> Notice: This UI Health Care e-mail (including attachments) is covered by
> the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is
> confidential and may be legally privileged.  If you are not the intended
> recipient, you are hereby notified that any retention, dissemination,
> distribution, or copying of this communication is strictly prohibited.
>  Please reply to the sender that you have received the message in error,
> then delete it.  Thank you.
> ________________________________
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20140804/5e8214b4/attachment-0001.html>


More information about the Insight-users mailing list