[Paraview] NRRD space dimensions probem with Paraview

Moreland, Kenneth kmorel at sandia.gov
Tue Aug 13 19:27:46 EDT 2013


No, the data is not resampled. The correct scalar values are placed on the transformed points and then the scalars are interpolated between the points for locations inside the cells.

-Ken

From: <Greer>, Cody <cody.greer at wustl.edu<mailto:cody.greer at wustl.edu>>
Date: Tuesday, August 13, 2013 5:16 PM
To: Kenneth Moreland <kmorel at sandia.gov<mailto:kmorel at sandia.gov>>, "paraview at paraview.org<mailto:paraview at paraview.org>" <paraview at paraview.org<mailto:paraview at paraview.org>>
Subject: [EXTERNAL] RE: [Paraview] NRRD space dimensions probem with Paraview

Hi Ken,

Thanks very much for your prompt reply!  I implemented your workaround and it seems to be working well.  I just have one further question:  Does this technique involve any resampling of the pixel values?  We want to avoid resampling in order to keep the best image quality possible.  The filter combination that you suggest seems to avoid resampling, but do you know whether the final rendering stage resorts to resampling?  In other words, does the renderer use interpolation to force points to be aligned across slices?

Thanks,
Cody



________________________________
From: Moreland, Kenneth <kmorel at sandia.gov<mailto:kmorel at sandia.gov>>
Sent: Tuesday, August 13, 2013 12:37 PM
To: Greer, Cody; paraview at paraview.org<mailto:paraview at paraview.org>
Subject: Re: [Paraview] NRRD space dimensions probem with Paraview

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/a9cd5dae/attachment-0001.htm>


More information about the ParaView mailing list