<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hi,<br><br>I'm on the same problem (using vtkSeedWidget and points does not disappear after slice change), and after a lot of google search, this message appears ( :) ). But I have some questions:<br><br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">From Karthik: What is the output display bounds of the result of vtkImageReslice. I<br>presume you are passing it through to vtkImageActor. If the display<br>bounds, as you scroll through slices do change, the seeds should<br>appear and disappear automatically.<br>Since the ImageActor doesn't have a SetBounds() method and ImageReslice doesn't have a GetBounds() method, how to do this? . <br><br>Another question:<br>When I call a the following on my callback, on Execute(vtkObject*, unsigned long,
void*) method:<br>if( event == vtkCommand::PlacePointEvent)<br> {<br> std::cout << "A point are placed!"<< std::endl;<br> cout << "Point placed, total of:" << this->SeedRepresentation->GetNumberOfSeeds() << "\n";<br> double vc[3];<br> double wc[3];<br> this->SeedRepresentation->GetSeedWorldPosition(this->SeedRepresentation->GetNumberOfSeeds() - 1, vc);<br> this->SeedRepresentation->GetSeedDisplayPosition(this->SeedRepresentation->GetNumberOfSeeds() - 1, wc);<br> std::cout << "Printing the word coordinate: " << vc[0] << ", " << vc[1] << ", " << vc[2] << std::endl;<br> std::cout << "Printing the display coordinate: " << wc[0] << ", " << wc[1] << ", " << wc[2] <<
std::endl;<br> }<br>The output never show a valid Z value. If are in display coordinate, are every times 0 ( which I think are correct, since I'm are using a 2D viewer ).<br>But and in world coordinate? My access of this value of course are wrong. Can someone help me with these?<br><br>Sorry by the newbie question and thanks in advance,<br><br>Wagner Sales<br><br><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;">----- Mensagem original ----<br>De: Ken Urish <ken.urish@gmail.com><br>Para: Karthik Krishnan <karthik.krishnan@kitware.com>; vtkusers@vtk.org<br>Enviadas: Terça-feira, 29 de Abril de 2008 13:44:07<br>Assunto: Re: [vtkusers] vtkSeedWidget<br><br>Karthik<br><br>Yes I am passing vtkImageReslice through an actor.<br>No, I am not declaring any bounds on the reslice. I am using the<br>example based off the ImageReslice test file. I assume I should set<br>the bounds in the Reslice callback (below).
Could you offer me what<br>command to use? I dont see object that looks like it will set bounds?<br>I really appreciate your help with this, I was up most of last night<br>trying to power through it.<br>Thanks, Ken<br><br>//------------------------------------------------------------------------------<br>// IMAGE RESLICE CALLBACK<br>// The mouse motion callback, to turn "Slicing" on and off<br>//-------------------------------------------------------------------------------<br>class vtkImageInteractionCallback : public vtkCommand<br>{<br>public:<br><br> static vtkImageInteractionCallback *New() {<br> return new vtkImageInteractionCallback; };<br><br> vtkImageInteractionCallback() {<br> this->Slicing = 0;<br> this->ImageReslice = 0;<br> this->Interactor = 0; };<br><br> void SetImageReslice(vtkImageReslice *reslice) {<br> this->ImageReslice = reslice;
};<br><br> vtkImageReslice *GetImageReslice() {<br> return this->ImageReslice; };<br><br> void SetInteractor(vtkRenderWindowInteractor *interactor) {<br> this->Interactor = interactor; };<br><br> vtkRenderWindowInteractor *GetInteractor() {<br> return this->Interactor; };<br><br> virtual void Execute(vtkObject *, unsigned long event, void *)<br> {<br> vtkRenderWindowInteractor *interactor = this->GetInteractor();<br><br> int lastPos[2];<br> interactor->GetLastEventPosition(lastPos);<br> int currPos[2];<br> interactor->GetEventPosition(currPos);<br><br> if (event == vtkCommand::LeftButtonPressEvent)<br> {<br> this->Slicing = 1;<br> }<br> else if (event == vtkCommand::LeftButtonReleaseEvent)<br>
{<br> this->Slicing = 0;<br> }<br> else if (event == vtkCommand::MouseMoveEvent)<br> {<br> if (this->Slicing)<br> {<br> vtkImageReslice *reslice = this->ImageReslice;<br><br> // Increment slice position by deltaY of mouse<br> int deltaY = (lastPos[1] - currPos[1]);<br><br> reslice->GetOutput()->UpdateInformation();<br> double sliceSpacing = reslice->GetOutput()->GetSpacing()[2];<br> vtkMatrix4x4 *matrix = reslice->GetResliceAxes();<br> // move the center point that we are slicing through<br> double point[4];<br> double center[4];<br>
point[0] = 0.0;<br> point[1] = 0.0;<br> point[2] = sliceSpacing * deltaY;<br> point[3] = 1.0;<br> std::cout<<point[2]<<std::endl;<br> matrix->MultiplyPoint(point, center);<br> matrix->SetElement(0, 3, center[0]);<br> matrix->SetElement(1, 3, center[1]);<br> matrix->SetElement(2, 3, center[2]);<br> interactor->Render();<br> }<br> else<br> {<br> vtkInteractorStyle *style = vtkInteractorStyle::SafeDownCast(<br> interactor->GetInteractorStyle());<br> if (style)<br> {<br>
style->OnMouseMove();<br> }<br> }<br> }<br> };<br><br><br>On Tue, Apr 29, 2008 at 8:31 AM, Karthik Krishnan<br><<a ymailto="mailto:karthik.krishnan@kitware.com" href="mailto:karthik.krishnan@kitware.com">karthik.krishnan@kitware.com</a>> wrote:<br>> The Seed widget uses a vtkHandleWidget internally for each seed, with<br>> the default representation being the 3D vtkPointHandleRepresentation3D<br>> class. The resulting primitives exist in world coordinates (and not on<br>> the overlay plane). So they should disappear when you move to the next<br>> slice.<br>><br>> What is the output display bounds of the result of vtkImageReslice. I<br>> presume you are passing it through to vtkImageActor. If the display<br>> bounds, as you scroll through slices do change, the
seeds should<br>> appear and disappear automatically.<br>><br>> HTH<br>> --<br>> karthik<br>><br>><br>><br>> On Tue, Apr 29, 2008 at 9:30 AM, Ken Urish <<a ymailto="mailto:ken.urish@gmail.com" href="mailto:ken.urish@gmail.com">ken.urish@gmail.com</a>> wrote:<br>> > Hey all,<br>> ><br>> > Im using vtkSeedWidget on a 3D image that I am viewing through<br>> > ImageReslice. When I place my seed points on a 2D slice, how can I<br>> > have the seed points disappear when I move to the next slice? Im<br>> > moving through ~100 slices and I dont want them building up. Is this<br>> > even possible? I appreciate the help.<br>> ><br>> > Thanks<br>> > --Ken--<br>> > _______________________________________________<br>>
> This is the private VTK discussion list.<br>> > Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>> > Follow this link to subscribe/unsubscribe:<br>> > <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>><br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></div></div></div><br>
<hr size=1>Novos endereços, o Yahoo! que você conhece. <a href="http://br.rd.yahoo.com/mail/taglines/mail/*http://br.new.mail.yahoo.com/addresses">Crie um email novo</a> com a sua cara @ymail.com ou @rocketmail.com.</body></html>