[vtkusers] orthogonal slices through a volume (and now non-orthogonal too).

David Gobbi dgobbi at atamai.com
Wed Aug 23 11:57:13 EDT 2006


Mark Gooding wrote:
> On 8/23/06, David Gobbi <dgobbi at atamai.com> wrote:
>
>> > ERROR: In \vtk\source\Filtering\vtkStreamingDemandDrivenPipeline.cxx,
>> > line 628
>> > vtkStreamingDemandDrivenPipeline (026B50E8): The update extent
>> > specified in the information for output port 0 on algorithm
>> > vtkImageReslice(026B4028) is 182 182 0 359 0 177, which is outside the
>> > whole extent 0 363 0 359 0 0.
>>
>> This is an issue with vtkImageActor.  The first time it runs, it sets
>> its DisplayExtent from the WholeExtent of its input.  If the WholeExtent
>> of the image ever changes afterwards, then it gives out the error that
>> you reported above.
>
> Whoops!!! I had a imageActor->SetDisplayExtent() left over from my
> display of othogonal planes. That was causing the error.
>
>> The trick is to reset the image actor DisplayExtent by setting it to
>> (-1, 0, 0, 0, 0, 0), which will force the image actor to recompute its
>> extent and position from the new WholeExtent instead of using old,
>> invalid values.  The idea here is that vtkImageReslice is giving you
>> exactly the slice that you want, so vtkImageActor should not be doing
>> any extent or slice selection.
>
> Ok, so changing my faulty code, either by
> SetDisplayExtent(-1,0,0,0,0,0) or removing the line altogether,
> results in the imageActor being displayed. But the plane is only the
> middle z-plane now, regardless of the AxesDirection specified in
> vtkImageReslice. (and the image displayed is correct for that
> location)
>
> Really puzzled now! Surely the imageActor can't change where
> vtkImageReslice is slicing?!?

No, it can't, not if you set reslice->SetOutputDimensionality(2).  If 
you don't set this, then the ImageActor actually can change the slice by 
virtue of the fact that ImageActor can specify the UpdateExtent that 
ImageReslice produces.

If you look carefully at the slice (I don't mean the position of the 
slice, but the actual image shown on the slice) are you sure it is the 
same for the different directions?

It is natural that the ImageActor will always be placed at the same 
position unless you use 
imageActor->SetUserMatrix(reslice->GetResliceAxes()) to make the 
ImageActor appear at the same location as the slice that it is showing.

>
> I also tried setting the display extent to the full image area, but
> that caused a terminating crash!

The display extent can only ever be set to a single slice, and also note 
that if you do set the display extent (which you shouldn't have to) you 
would need to set it to the whole extent of the _output_ of reslice, not 
the input.  And also note that the output of reslice will be permuted 
relative to the input due to the ResliceAxes (assuming that the 
ResliceAxes are a permutation matrix).


 - David



More information about the vtkusers mailing list