[Paraview-developers] Slice representation

Matthias Schneider schneider at vision.ee.ethz.ch
Mon Jul 14 10:52:35 EDT 2014


Hi,

I am trying to visualize volumetric image data (Uniform Rectilinear 
Grid) as single axial slices. The built-in "Slice" representation in 
ParaView has a rather 'non-intuitive' behavior -- from an 
image-processing point of view where I (would like to) consider a point 
as the center of a single voxel (as in ITK) rather than the voxel corner 
as used for Paraview's slice representation, which essentially results 
in slightly 'squeezed' pixels.

For example, consider an axial slice of 3x3 voxels with an isotropic 
voxel spacing of 1cm. Paraview's slice representation then renders a 
quad with the same *bounds* as the slice, i.e. the quad dimensions are 
2cm in each direction. The superimposed texture, however, shows 3x3 
voxels, which results in an effective/apparent voxel size of 2/3cm.

There might be different applications/data where this kind of 
representation is meaningful/desired (?) but it is rather misleading 
when trying to visualize volumetric image data.
Could anybody possibly comment on whether or not this behavior is 
intentional?

As I could not find an easy way to adjust this behavior for my needs, I 
was trying to include a 'voxel-centric slice' representation following 
the 'Plugin HowTo'. I more or less succeeded by adding my own data 
mappers that eventually use a modified version of vtkTexturePainter 
which renders the quad with outer bounds increased by half the spacing 
of the input slice - not quite sure if that will eventually have some 
other unexpected side effects.

There are two rather GUI-related issues that I did not get right yet.

1. How can I set the panel visibility of the "Slicing" property group to 
default for the modified slice representation?
The representation xml file uses the 
panel_visibility_default_for_representation attribute to select a single 
representation for default visibility in the SliceRepresenation proxy:

<ExposedProperties>
<PropertyGroup label="Slicing">
   <Property name="SliceMode"
             panel_visibility="advanced"
             panel_visibility_default_for_representation="slice" />
   <Property name="Slice"
             panel_visibility="advanced"
             panel_visibility_default_for_representation="slice" />
</PropertyGroup>
</ExposedProperties>

Is there any way to add the modified slice representation without 
duplicating the GUI elements?

Also not quite sure what the meaning of the share property exception is:
<ShareProperties subproxy="SliceRepresentation">
   <Exception name="Input" />
   <Exception name="Visibility" />
</ShareProperties>
I couldn't find any proper documentation for these parts but it might be 
related to the visibility problem.

2. When loading new image data from a file into ParaView and selecting 
the modified slice representation, I always get a 'Failed to locate 
selected scalars. Will use image scalars by default.' error. Doing the 
same with the built-in slice representation, the 'MetaImage' point 
attribute containing the image data gets selected automatically. The 
error vanishes of course when I manually select the point attribute. Am 
I missing something here or what is the 'trick' to automatically select 
the point attribute?

Any hint is appreciated very much!

I am more than happy to provide the source code if that helps.


Kind regards,
Matthias


More information about the Paraview-developers mailing list