SCI Seg3D Mailing List

Text archives Help

[Seg3D] Re: Segmentation export format

Chronological Thread 
  • From: Ramón Casero Cañas <>
  • To:
  • Subject: [Seg3D] Re: Segmentation export format
  • Date: Tue, 29 May 2012 11:01:48 +0100

On 29/05/12 09:52, Sergio Vera wrote:

Dear Seg3D Devs,

the old Seg3D (v1) allowed to export segmentation mask in several image
formats (mha, mhd, nrrd and many others)
Currently Seg3D2 only allows to export in nrrd format. This sometimes
generates the need to transform nnrd into other formats to be read by
other applications.

It is possible to add other formats to export segmentations?
Each time you have to convert an image from a format to another there is
a chance that some info on the header may end up messed badly.

Hi Segio,

Actually, Seg3D2 allows to export to other formats other than nrrd. But for example, the exporter to mat is broken and doesn't export the header information, only the segmentation itself.

Or you can read mha files, but the exporter is not provided.

So yes, at the moment it's a bit unusable.

I'm getting along by exporting to mat, then loading it in Matlab, reconstructing the header, then saving it back.

A couple of days ago, Gregory Jefferies posted in the teem list about some code to load nrrd files in Matlab, I haven't tried it, but it's maybe worth having a look

I posted some code here a few months back that could perhaps be of interest to people wanting to access nrrd files in matlab [1] [2]

[1] is a very basic pure matlab nrrd reader. There are many limitations, but sometimes compiling teem etc is more effort than necessary to a read a couple of simple 3D raw or gzipped files.
[2] is just the matlab mex code from the teem library but includes a more intelligent compilethis.m script that pretty reliably finds the location of teem libraries (ie no need to manually edit to point at teem location). Perhaps this would be worth adding to teem.

I use these in conjunction with this:

which calls whichever version is available (preferring [2]) and provides similar return values and image orientations. All this code also works fine from GNU Octave.



Dr. Ramón Casero Cañas

Computational Biology
Department of Computer Science
University of Oxford
Wolfson Building, Parks Rd
Oxford OX1 3QD

tlf     +44 (0) 1865 610737

Archive powered by MHonArc 2.6.16.

Top of page