<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body aria-label="Message body" fpstyle="1" tabindex="0" dir="ltr" style="word-wrap: break-word; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri,sans-serif;">
<div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family: Calibri,Arial,Helvetica,sans-serif; font-size: 12pt; color: #000000; margin: 0">
Hi Ken,<br>
<br>
Thanks very much for your prompt reply!&nbsp; I implemented your workaround and it seems to be working well.&nbsp; I just have one further question:&nbsp; Does this technique involve any resampling of the pixel values?&nbsp; We want to avoid resampling in order to keep the best
 image quality possible.&nbsp; The filter combination that you suggest seems to avoid resampling, but do you know whether the final rendering stage resorts to resampling?&nbsp; In other words, does the renderer use interpolation to force points to be aligned across slices?<br>
<br>
Thanks,<br>
Cody<br>
<br>
<br>
<br>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" color="#000000" face="Calibri, sans-serif"><b>From:</b> Moreland, Kenneth &lt;kmorel@sandia.gov&gt;<br>
<b>Sent:</b> Tuesday, August 13, 2013 12:37 PM<br>
<b>To:</b> Greer, Cody; paraview@paraview.org<br>
<b>Subject:</b> Re: [Paraview] NRRD space dimensions probem with Paraview</font>
<div>&nbsp;</div>
</div>
<div>
<div>Cody,</div>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>Here is a workaround that, although tiresome, should work for your problem.</div>
<div><br>
</div>
<div>1. Remove both the &quot;spacings&quot; and the &quot;space directions&quot; field. Load that into ParaView. (The data will be scaled by 1 on each axis).</div>
<div>2. Apply the &quot;Image Data to Point Set&quot; filter on the NRRD data.</div>
<div>3. Add the &quot;Calculator&quot; filter to the Image Data to Point Set filter. Turn on the &quot;Coordinate Results&quot; option (it is an advanced option), and set the equation to the following string: &quot;coordsX*(.325*iHat) &#43; coordsY*(.2815*jHat&#43;.1625*kHat) &#43; coordsZ*(-4.3301*jHat
 &#43; 2.5*kHat)&quot;.</div>
<div><br>
</div>
<div>Once you apply the Calculator filter, the data should be scaled and skewed how you want it.</div>
<div><br>
</div>
<div>-Ken</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; border-bottom:medium none; border-left:medium none; padding-bottom:0in; padding-left:0in; padding-right:0in; border-top:#b5c4df 1pt solid; border-right:medium none; padding-top:3pt">
<span style="font-weight:bold">From: </span>&lt;Greer&gt;, Cody &lt;<a href="mailto:cody.greer@wustl.edu">cody.greer@wustl.edu</a>&gt;<br>
<span style="font-weight:bold">Date: </span>Monday, August 12, 2013 4:16 PM<br>
<span style="font-weight:bold">To: </span>&quot;<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>&quot; &lt;<a href="mailto:paraview@paraview.org">paraview@paraview.org</a>&gt;<br>
<span style="font-weight:bold">Subject: </span>[EXTERNAL] [Paraview] NRRD space dimensions probem with Paraview<br>
</div>
<div><br>
</div>
<div><style id="owaParaStyle" type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
body
        {font-family:Calibri,Arial,Helvetica,sans-serif;
        font-size:12pt;
        color:#000000;
        margin:0}
p
        {margin-top:0;
        margin-bottom:0}
body
        {font-family:Calibri,Arial,Helvetica,sans-serif;
        font-size:12pt;
        color:#000000;
        margin:0}
body
        {font-family:Calibri,Arial,Helvetica,sans-serif;
        font-size:12pt;
        color:#000000;
        margin:0}
body
        {font-family:Calibri,Arial,Helvetica,sans-serif;
        font-size:12pt;
        color:#000000;
        margin:0}
body
        {font-family:Calibri,Arial,Helvetica,sans-serif;
        font-size:12pt;
        color:#000000;
        margin:0}
body
        {font-family:Calibri,Arial,Helvetica,sans-serif;
        font-size:12pt;
        color:#000000;
        margin:0}
-->
BODY {font-family: Calibri,Arial,Helvetica,sans-serif; font-size: 12pt; color: #000000; margin: 0}P {margin-top:0;margin-bottom:0;}BODY {font-family: Calibri,Arial,Helvetica,sans-serif; font-size: 12pt; color: #000000; margin: 0}BODY {font-family: Calibri,Arial,Helvetica,sans-serif; font-size: 12pt; color: #000000; margin: 0}BODY {font-family: Calibri,Arial,Helvetica,sans-serif; font-size: 12pt; color: #000000; margin: 0}</style>
<div tabindex="0" dir="ltr">
<div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:#000000; margin:0">
Dear Paraview community,<br>
<br>
I am trying to use Paraview to render a volume composed of several slices acquired with a microscope.&nbsp; Due to our method of data acquisition, the slices do not line up exactly.&nbsp; They are skewed at a certain angle.&nbsp; So the image stack is shaped like a parallelepiped
 rather than the conventional cuboid shape.&nbsp; 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 &quot;space directions&quot; property in the
 nrrd header file (see below).<br>
<br>
I have written the nrrd header file as below, but I cannot get Paraview to render the stack correctly.&nbsp; It just renders the stacks in a cuboid shape as if I never even set the &quot;space directions&quot; property.&nbsp; Have I written the header file incorrectly, or am I
 forgetting something?&nbsp; Or maybe paraview cannot make use of this metadata?&nbsp; I have double checked my geometry, and I believe that the space directions vectors are correct.<br>
<br>
NRRD0005<br>
type: uint16<br>
data file: stack_2560_2160_200_uint16.raw<br>
dimension: 3<br>
sizes: 2560 2160 200<br>
spacings:&nbsp; .325 .325 5<br>
space directions: (.325,0,0) (0,.2815,.1625) (0,-4.3301,2.5)<br>
thicknesses: nan nan 5<br>
encoding: raw<br>
endian: little<br>
<br>
Thanks for your help,<br>
Cody Greer<br>
Washington University in St. Louis<br>
</div>
</div>
</div>
</span></div>
</div>
</body>
</html>