[ITK-users] Extensions to the MetaImage (MHDs) IO-plugin to support compression and MHAs
Williams, Norman K
norman-k-williams at uiowa.edu
Mon Jul 28 13:34:50 EDT 2014
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.
________________________________
More information about the Insight-users
mailing list