[vtkusers] reslice problem

Matei MANCAS matei.mancas at tcts.fpms.ac.be
Tue Feb 4 10:32:43 EST 2003


Yesss!!!

thank you very much!!

It works well now!!

Matei

----- Original Message -----
From: "David Gobbi" <dgobbi at imaging.robarts.ca>
To: "Matei MANCAS" <matei.mancas at tcts.fpms.ac.be>
Cc: "VTK-User" <vtkusers at public.kitware.com>
Sent: Tuesday, February 04, 2003 4:04 PM
Subject: Re: [vtkusers] reslice problem


> Hi Matei,
>
> You have given a z spacing of 0.0 to the reader:
>
> noduleReader->SetDataSpacing(1,1,0.0);
>
> You should instead set the z spacing to the distance from the
> centre of one slice to the centre of the next slice.
>
> Cheers,
>   - David
>
> --
>   David Gobbi, MSc                dgobbi at imaging.robarts.ca
>   Advanced Imaging Research Group
>   Robarts Research Institute, University of Western Ontario
>
> On Tue, 4 Feb 2003, Matei MANCAS wrote:
>
> > Hi all!!!
> >
> > I use vtkImageReslice to change the view on a set of 348 slices in order
to get coronal or sagital views...
> > My code is :
> >
> > vtkRenderer *renderer;
> > vtkTIFFReader *noduleReader;
> > vtkImageMapper *noduleMapper;
> > vtkImageActor *noduleActor;
> > noduleReader = vtkTIFFReader::New();
> > noduleMapper = vtkImageMapper::New();
> > renderer = vtkRenderer::New();
> > noduleActor = vtkImageActor::New();
> >
> >
> > noduleMapper->SetColorWindow(255.0); // Width -- We are working in 8
bits...
> > noduleMapper->SetColorLevel(255.0/2); // Center
> >
> > noduleReader->SetFilePrefix("..........");
> >
> > noduleReader->SetFilePattern("%s%.4d.tif");
> > noduleReader->SetFileNameSliceOffset(1);
> > noduleReader->SetDataExtent(0,511,0,511,0,347);
> > noduleReader->SetDataSpacing(1,1,0.0);
> >
> >
> >     // reslice
> >
> > vtkImageReslice *reslice = vtkImageReslice::New();
> > reslice->SetInput(noduleReader->GetOutput());
> >
> > reslice->SetResliceAxesDirectionCosines(1,0,0, 0,0,1, 0,1,0); //
exchange y and z
> > reslice->SetOutputSpacing(1, 1, 1);
> > reslice->SetOutputExtent(0,511,0,511,0,347);
> >
> > noduleActor->SetInput(reslice->GetOutput());
> > noduleActor->SetDisplayExtent(0,511,0,511,0,347);
> > noduleActor->SetZSlice(300);
> >
> > renderer->AddActor(noduleActor);
> >
> >
> > It works well (I get the 300th slice when I don't use reslice) but I
have a black screen using reslice->SetResliceAxesDirectionCosines(1,0,0,
0,0,1, 0,1,0); for exchanging y and z axes. I would want to see all my
slices but
> >
> > It is possible that it is due to the camera which has no more a view on
the new object...
> >
> > Can anyone help me please?????
> >
> > Thanks
> >
> > Matei
> >
>
>




More information about the vtkusers mailing list