[Paraview] NRRD space dimensions probem with Paraview

Moreland, Kenneth kmorel at sandia.gov
Tue Aug 13 12:37:22 EDT 2013


Cody,

Unfortunately, ParaView's NRRD reader does not support the space directions parameter in the way you want to use it. The data type the NRRD reader produces (a vtkImageData) only supports axis-aligned points, so only the magnitudes of the space directions are used. For the NRRD reader to produce another data type that supports more arbitrary point positions would break other code that relies on the NRRD reader.

Here is a workaround that, although tiresome, should work for your problem.

1. Remove both the "spacings" and the "space directions" field. Load that into ParaView. (The data will be scaled by 1 on each axis).
2. Apply the "Image Data to Point Set" filter on the NRRD data.
3. Add the "Calculator" filter to the Image Data to Point Set filter. Turn on the "Coordinate Results" option (it is an advanced option), and set the equation to the following string: "coordsX*(.325*iHat) + coordsY*(.2815*jHat+.1625*kHat) + coordsZ*(-4.3301*jHat + 2.5*kHat)".

Once you apply the Calculator filter, the data should be scaled and skewed how you want it.

-Ken

From: <Greer>, Cody <cody.greer at wustl.edu<mailto:cody.greer at wustl.edu>>
Date: Monday, August 12, 2013 4:16 PM
To: "paraview at paraview.org<mailto:paraview at paraview.org>" <paraview at paraview.org<mailto:paraview at paraview.org>>
Subject: [EXTERNAL] [Paraview] NRRD space dimensions probem with Paraview

Dear Paraview community,

I am trying to use Paraview to render a volume composed of several slices acquired with a microscope.  Due to our method of data acquisition, the slices do not line up exactly.  They are skewed at a certain angle.  So the image stack is shaped like a parallelepiped rather than the conventional cuboid shape.  The nrrd file format seems like a good candidate to allow us to render these skewed volumes since nrrd allows one to relate data space with physical/global space by setting the "space directions" property in the nrrd header file (see below).

I have written the nrrd header file as below, but I cannot get Paraview to render the stack correctly.  It just renders the stacks in a cuboid shape as if I never even set the "space directions" property.  Have I written the header file incorrectly, or am I forgetting something?  Or maybe paraview cannot make use of this metadata?  I have double checked my geometry, and I believe that the space directions vectors are correct.

NRRD0005
type: uint16
data file: stack_2560_2160_200_uint16.raw
dimension: 3
sizes: 2560 2160 200
spacings:  .325 .325 5
space directions: (.325,0,0) (0,.2815,.1625) (0,-4.3301,2.5)
thicknesses: nan nan 5
encoding: raw
endian: little

Thanks for your help,
Cody Greer
Washington University in St. Louis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130813/4526a97a/attachment-0001.htm>


More information about the ParaView mailing list