SCI Seg3D Mailing List

Text archives Help

[Seg3D] Re: Re: Re: Matlab files: Spacing

Chronological Thread 
  • From: Ramón Casero Cañas <>
  • To:
  • Subject: [Seg3D] Re: Re: Re: Matlab files: Spacing
  • Date: Mon, 05 Mar 2012 14:22:40 +0000

On 03/03/12 01:36, Ayla Khan wrote:
Hi Peter,

It's not possible to set spacing in a standard Matlab matrix file since there 
is no metadata to fill in that information, however you can create a struct 
that can be read by Seg3D that can contain your data and additional 

This is a bit rough, and I'm not a Matlab expert, but here are the commands I 
used to create a struct from your matrix file:

s=struct(); = L2;
s.axis = struct('spacing', [0.5]);
s.axis(2,1) = struct('spacing', [0.5]);
s.axis(3,1) = struct('spacing', [3.0]);

Seg3D 1.x expected to be a 4D array and s.axis a 4-vector, with a dummy dimension as the first dimension, if I'm not wrong. Has this changed in Seg3D 2? Maybe that's why my .mat data is not loaded correctly.

Peter, we have developed quite a bit of Matlab code to interact with Seg3D. Instructions to check it out here

For example, you can load image and metadata with

nrrd = scinrrd_load('image.mat');

or convert a normal array into a struct for Seg3D

nrrd = scinrrd_im2nrrd(im, resolution, offset);

Best regards,


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