[Paraview] combining a voxel-based stat file with a surface mesh?
David E DeMarle
dave.demarle at kitware.com
Thu May 24 15:30:03 EDT 2012
Not sure if this is what you are trying but you can always sample
values from a field onto a mesh by using the ResampleWithDataset
filter.
See the attached state file for a demo.
David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909
On Thu, May 24, 2012 at 3:01 PM, Tom Schoenemann <toms at indiana.edu> wrote:
> Just wondering if anyone had any hints they could give me about things to
> try.
>
> -Tom
>
> On May 19, 2012, at 10:16 AM, Tom Schoenemann wrote:
>
> So, how would one "layer" a stat (voxel data) file over a mesh file, to
> color code the surface of the mesh?
>
> -Tom
>
> On May 18, 2012, at 7:14 PM, Tom Schoenemann wrote:
>
> I have figured out how to get my surface meshes (from ITK-SNAP) to line up
> perfectly with my stat data (calculated originally on the same image). Here
> is how I did it:
>
> 1) reflected the ITK-SNAP surface mesh about the X axis:
> With the surface mesh highlighted in the pipeline browser, select
> Filters>Alphabetical>Reflect
> set:
> Plane: X
> Center: 0
> Press "apply"
>
> 2) load the stat data file (press "apply")
> Go to the Information tab for this file and note the X, Y, and Z range
> bounds for this file. The bounds for my image say, for example:
> X range: 109 to 218 (delta: 109)
> Y range: -107 to -0.5 (delta: 106)
> Z range: 136 to 272 (delta: 136)
>
> 3) return to the ITK-SNAP surface mesh, reflected version (click on the
> "Reflect" object in the pipeline browser listed just below your ITK-SNAP
> surface mesh file, so that it is highlighted). Then select:
> Filters>Alphabetical>Transform
> In the "Translate" boxes of the Transform properties tab, enter the first
> number for each of your X, Y, and Z ranges, that you noted in step 2 above,
> in each of the boxes (unfortunately not labeled "X", "Y" and "Z").
> E.g., for my data, the boxes for the "Translate" row would read:
> Translate: 109 -107 136
> Leave the "Rotate" and "Scale" at their default values.
> Press "apply"
>
> This moves the mesh to perfectly overlap my stat data.
>
> However, now I can't figure out how to have the stat data attach to my
> beautiful ITK-SNAP surface mesh. I tried
> Filters>Alphabetical>Append Attributes
> with both the translated (and previously reflected) mesh highlighted along
> with the stat data file, but this doesn't seem to work. The
> AppendAttributes object now claims to have my stat data attached (Properties
> shows them as scalars), but there is no option to display them. The "color
> by" option under the display tab for this object only has "solid color" as
> an option. Any ideas how I might be able to get these scalars to display on
> my beautiful mesh?
>
> -Tom
>
> On May 18, 2012, at 12:38 PM, Tom Schoenemann wrote:
>
> OK, so Paraview screws up NIFTI coordinates, or doesn't read the header
> right? The surface mesh that ITK-SNAP makes is in vtk format, so it must be
> that ITK-SNAP doesn't put the orientation info into the right format?
>
> Looking closely at my image, I can see that the vtk mesh in Paraview is
> indeed left-right reversed compared to the original in ITK-SNAP (in addition
> to being shifted in various ways out of alignment inexplicably).
>
> Here are the bounds in Paraview for the mesh:
>
> X range: -98.9 to -9.78 (delta: 89.1)
>
> If I put the following for Reflect:
> plane: X
> center: 50
>
> Then the images are no longer left-right reversed from each other, but they
> are still not overlapping. There is some kind of Y and Z shift also going
> on.
>
> -Tom
>
>
> On May 17, 2012, at 11:51 AM, Philip A Cook wrote:
>
> Trying this out on some actual data - it seems the reflection should
> actually be about the boundary of the image, not the center. Here the
> x-bounds of my image are 114 to 337 in Paraview (note this does not agree
> with the NIFTI or ITK coordinates), so I reflected the mesh (blue) about 114
> in the x-axis, giving me what I think is a correctly oriented mesh.
>
> Unfortunately, there appear to be other transformations at play as well. You
> can't see it in this view but the red mesh is offset in the Z-axis. I think
> this is because of the disagreement between the NIFTI and Paraview
> coordinates.
>
> <PastedGraphic-1.png>
>
> On May 17, 2012, at 10:36 AM, Philip A Cook wrote:
>
> Hi,
>
>
> I have had some success with the Reflect filter. Often the SNAP meshes are
> reflected about the origin of the image. Thus I do Reflect on the mesh (I
> always find it easier to transform the mesh rather than the image in
> Paraview), with Plane set to X / Y / Z as appropriate, and Center set to the
> Center of the image.
>
>
> The Center of the image in Paraview might not agree with what's in the image
> header, at least not for NIFTI files. You can figure out the Center in
> Paraview by selecting the image and then looking at the Information tab. The
> Bounds box will tell you the min and max in each coordinate. For the Reflect
> filter, you want the Center to be halfway between the min and max bound of
> the image.
>
>
> This usually solves my problems with meshes and images not lining up. I'm
> assuming here that you are loading the same image from which the mesh was
> defined.
>
>
>
> Phil
>
>
>
> On May 16, 2012, at 11:53 PM, Tom Schoenemann wrote:
>
>
> OK, that worked. I've figured out how it works, following what you
> suggested.
>
>
> Unfortunately, Paraview didn't just shift the data over, leaving it in the
> same orientation, it also inexplicably changed the orientation by several
> degrees (??). Even if I am able to get the two boxes in basically the same
> location, the shifted orientation makes it impossible to be confident the
> data are overlaid in the right places. This is very frustrating.
> Apparently Paraview makes random changes to the orientation?? Why on earth
> would it do that?
>
>
> -Tom
>
>
> On May 16, 2012, at 5:18 PM, Scott, W Alan wrote:
>
>
> So, I just tried the following:
>
> *Sources/ Wavelet. Apply. Display this by Outline.
>
> * Filters/ Alphabetical/ Transform. Translate X by 10. Apply.
>
> * Leaving the Transform filter highlighted in the pipeline browser, Filters/
> Common/ Contor. Apply.
>
> * Now, if you turn on visibility of the original Wavelet, you see that the
> wavelet has moved along with the contour.
>
>
> Or are you saying you want to move the two different files? Then, you use
> two transforms – one per file.
>
>
> Alan
>
>
> From: paraview-bounces at paraview.org [mailto:paraview-bounces at paraview.org]
> On Behalf Of Tom Schoenemann
>
> Sent: Wednesday, May 16, 2012 2:41 PM
>
> To: Samuel Key
>
> Cc: paraview at paraview.org
>
> Subject: [EXTERNAL] Re: [Paraview] different orientation of input files
>
>
> I must be missing something. It only seems to move the bounding box, but
> not the location of the contour itself.. Not sure what that would be useful
> for, but in any case, I need to move the contour and/or data within the
> workspace, so the two overlap. Transform is only changing the box, not
> changing the location of the object within the box. Again, maybe I'm
> missing something.
>
>
> -Tom
>
>
> On May 16, 2012, at 2:32 PM, Samuel Key wrote:
>
>
>
> Tom,
>
>
> Will the Transform filter work for you? (Filters>Alphabetical>Transform)
>
>
> It works for me with unstructured meshes. I don't know if it will work with
> a surface mesh produced ITK-SNAP.
>
>
> Sam Key
>
>
> On 5/16/2012 10:29 AM, Tom Schoenemann wrote:
>
> Hi everyone,
>
>
> I have a question about changing/editing the orientation and origin
> information about an input file. Basically, the problem is this: I have a
> 3D volume (originally voxel data) file that contains statistics on its
> surface that I want to display color-coded. I can create a nice smoothed
> version of the surface using a different piece of software (ITK-SNAP), and
> this is the surface I'd like to use to display my stats (Paraview does not
> allow you to smooth the surface in the same way that ITK-SNAP does,
> eliminating the stair-step surface artifacts). I can indeed read both the
> stats file and the surface file from ITK-SNAP into Paraview, but
> unfortunately they now have different origins. That is, they don't overlap
> (the bounding box for the stats is completely outside the surface model that
> ITK-SNAP created.
>
>
> Originally, both files had the same orientation and origin: ITK-SNAP used
> the same file to create the beautiful surface that the stats were created
> with.
>
>
> So Paraview apparently does not read the header info the same way for the
> two types of files, even though ITK-SNAP does.
>
>
> Is there a way to change the origin and/or orientation of files in Paraview?
> I'm assuming there is a simple transform I could figure out by trial and
> error to get them to overlap again, but I don't know how or where I would do
> this.
>
>
> Thanks for any suggestions!
>
>
> -Tom
>
>
> _________________________________________________
>
> P. Thomas Schoenemann
>
>
> Associate Professor
>
> Department of Anthropology
>
> Indiana University
>
> Bloomington, IN 47405
>
> Phone: 812-855-8800
>
> E-mail: toms at indiana.edu
>
>
> Open Research Scan Archive (ORSA) Co-Director
>
> Consulting Scholar
>
> Museum of Archaeology and Anthropology
>
> University of Pennsylvania
>
>
> Homepage: http://mypage.iu.edu/~toms/
>
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
>
> Powered by www.kitware.com
>
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
>
> Follow this link to subscribe/unsubscribe:
>
> http://www.paraview.org/mailman/listinfo/paraview
>
>
> _________________________________________________
>
> P. Thomas Schoenemann
>
>
> Associate Professor
>
> Department of Anthropology
>
> Indiana University
>
> Bloomington, IN 47405
>
> Phone: 812-855-8800
>
> E-mail: toms at indiana.edu
>
>
> Open Research Scan Archive (ORSA) Co-Director
>
> Consulting Scholar
>
> Museum of Archaeology and Anthropology
>
> University of Pennsylvania
>
>
> Homepage: http://mypage.iu.edu/~toms/
>
>
>
>
>
>
>
>
>
>
> _________________________________________________
>
> P. Thomas Schoenemann
>
>
> Associate Professor
>
> Department of Anthropology
>
> Indiana University
>
> Bloomington, IN 47405
>
> Phone: 812-855-8800
>
> E-mail: toms at indiana.edu
>
>
> Open Research Scan Archive (ORSA) Co-Director
>
> Consulting Scholar
>
> Museum of Archaeology and Anthropology
>
> University of Pennsylvania
>
>
> Homepage: http://mypage.iu.edu/~toms/
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
>
> Powered by www.kitware.com
>
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
>
> Follow this link to subscribe/unsubscribe:
>
> http://www.paraview.org/mailman/listinfo/paraview
>
>
> _______________________________________________
>
> Powered by www.kitware.com
>
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
>
> Follow this link to subscribe/unsubscribe:
>
> http://www.paraview.org/mailman/listinfo/paraview
>
>
>
> _________________________________________________
> P. Thomas Schoenemann
>
> Associate Professor
> Department of Anthropology
> Indiana University
> Bloomington, IN 47405
> Phone: 812-855-8800
> E-mail: toms at indiana.edu
>
> Open Research Scan Archive (ORSA) Co-Director
> Consulting Scholar
> Museum of Archaeology and Anthropology
> University of Pennsylvania
>
> Homepage: http://mypage.iu.edu/~toms/
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
> _________________________________________________
> P. Thomas Schoenemann
>
> Associate Professor
> Department of Anthropology
> Indiana University
> Bloomington, IN 47405
> Phone: 812-855-8800
> E-mail: toms at indiana.edu
>
> Open Research Scan Archive (ORSA) Co-Director
> Consulting Scholar
> Museum of Archaeology and Anthropology
> University of Pennsylvania
>
> Homepage: http://mypage.iu.edu/~toms/
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
> _________________________________________________
> P. Thomas Schoenemann
>
> Associate Professor
> Department of Anthropology
> Indiana University
> Bloomington, IN 47405
> Phone: 812-855-8800
> E-mail: toms at indiana.edu
>
> Open Research Scan Archive (ORSA) Co-Director
> Consulting Scholar
> Museum of Archaeology and Anthropology
> University of Pennsylvania
>
> Homepage: http://mypage.iu.edu/~toms/
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>
> _________________________________________________
> P. Thomas Schoenemann
>
> Associate Professor
> Department of Anthropology
> Indiana University
> Bloomington, IN 47405
> Phone: 812-855-8800
> E-mail: toms at indiana.edu
>
> Open Research Scan Archive (ORSA) Co-Director
> Consulting Scholar
> Museum of Archaeology and Anthropology
> University of Pennsylvania
>
> Homepage: http://mypage.iu.edu/~toms/
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: resampleexample.pvsm
Type: application/octet-stream
Size: 116382 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120524/01fd7834/attachment-0001.obj>
More information about the ParaView
mailing list