Text archives Help
- From: Ayla Khan <ayla@sci.utah.edu>
- To: seg3d@sci.utah.edu
- Subject: [Seg3D] Re: Re: Re: Re: Matlab files: Spacing
- Date: Sun, 8 Apr 2012 23:05:53 -0600
Sorry about the delay in answering this question. Seg3D2 can read 4D Matlab
structs with the first dimension as a dummy dimension (size == 1) and also 3D
structs. In the case of the 4D structs, the first dimension is simply ignored
and the information from the remaining axes is read in as a 3D struct.
Ayla
On Mar 5, 2012, at 7:22 AM, Ramón Casero Cañas wrote:
>
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
>
> information.
>
>
>
> 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();
>
> s.data = 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 s.data 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
>
>
http://code.google.com/p/gerardus/source/checkout
>
>
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,
>
>
Ramon.
>
>
--
>
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
>
web http://web.comlab.ox.ac.uk/people/Ramon.CaseroCanas
>
photos http://www.flickr.com/photos/rcasero/
- [Seg3D] Re: Re: Re: Re: Matlab files: Spacing, Ayla Khan, 04/08/2012
Archive powered by MHonArc 2.6.16.