Hi Rodolfo, <br><br>Thanks for your code and help. One last question: Which particular key on the keyboard causes the callback to be invoked?? Where do you define this key? <br><br>Thanks very much again. <br><br>Best Regards,
<br>Rashed <br><br><div><span class="gmail_quote">On 7/28/06, <b class="gmail_sendername"><a href="mailto:scsrsao@leeds.ac.uk">scsrsao@leeds.ac.uk</a></b> <<a href="mailto:scsrsao@leeds.ac.uk">scsrsao@leeds.ac.uk</a>> wrote:
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi...<br><br> Sorry I didn't reply till now, but I didn't check my email yesterday afternoon
<br>XD... now to the questions...<br><br>>Hi Rodolfo,<br>><br>>Thanks for the code! I was actually too looking for how I could get orthogonal<br>>views through a volume. I had a question: Does your code allow you to drag and
<br>>move the orthogonal slices with a mouse, back and forth? If you needed this<br>>extra functionality, how would you modify your code? I guess you put some sort<br>>of window interactor.<br>><br>>Thanks in advance for your help, and thanks again for the code.
<br>><br>><br>>Rashed<br><br>Hmmm.... to actually manage the interaction with the mouse I guess you would not<br>clearly need to override some of the methods of the vtkRenderWindowInteractor<br>class and do some work to first select the slice (pick it) and so forth.. I've
<br>done some work to actually move the slices, but using either the keyboard or<br>some external graphical interface (buttons and slide bars, etc)... I did have a<br>hard time trying to find how to do this thins, so I'm attaching a bit of code
<br>to do this using keyboard... from there you should be able to extend it for<br>interface or use it as a first step to do mouse interactions...<br><br>first, you need to overload the function to handle the key events (or at least
<br>thats how I understand the whole thing)<br>static void keyPressedFunction(vtkObject* obj, unsigned long,void *sr, void *){<br><br><br> vtkRenderWindowInteractor* iren = vtkRenderWindowInteractor::SafeDownCast(obj);
<br> vtkImageDataGeometryFilter *imageFilter = (vtkImageDataGeometryFilter *)(sr);<br> xPos = xPos + 10;<br> imageFilter->SetExtent(xPos,xPos,0,374,0,99);<br> iren->Render();<br><br>}<br>
<br>And then add this handler to the render window interactor<br><br> vtkCallbackCommand *callback = vtkCallbackCommand::New();<br> callback->SetCallback(keyPressedFunction);<br> callback->SetClientData((void *)imageFilter);
<br><br> // I create the interactor to handle the render window<br> vtkRenderWindowInteractor *wInteractor = vtkRenderWindowInteractor::New();<br> wInteractor->SetRenderWindow(rWindow);<br> wInteractor->AddObserver(vtkCommand::KeyPressEvent, callback);
<br> wInteractor->Initialize();<br> wInteractor->Render();<br> wInteractor->Start();<br><br>> Ok, just ignore my question. After thinking about it, it was a stupid<br>> question :D<br>>
<br>> Actually, looking at the code for vtkImageViewer2.cxx, I am learning a lot.<br>> Thanks for that tip!<br>><br>> Cheers,<br>> Luca<br>><br><br>Ignoring the questions, however, just to say that there are no stupid questions
<br>;)... any how, the array values you get are the actual dimensions of your<br>dataset X: 0-511 etc... now, when slicing through the volume, usually you want<br>to get the whole exteng on two dimensions, while restricting the third one to
<br>just 1 slice (thats why in my code you can see things like 0..max 0..max<br>99..99)<br><br><br>>Hi Rodolfo,<br><br>>Ok, I am guessing this is returning me the number of slices in the YZ, XZ and<br>>XY direction.... am I correct in that?
<br>><br>>I guess I am asking you very basic questions... how are these 3D data<br>>organized? >I have a DICOm file which is split into 100 files...<br>><br>>Now, when I load this file into a DICOM reader and get the whole extent...
<br>><br>>I get the following array values:<br>><br>>0-511<br>>0-511<br>>0-99.<br>><br>>How is the volume data in the other dimensions (0-511) represented...<br>><br>>Ok, you might be laughing your ass off....
<br><br><br>>I have one final question for you.... What does the GetWholeExtent() function<br>>really do? I know I get six double values... but what do these values<br>>represent?<br>><br>>Luca<br><br>Cheers,
<br>Rodolfo<br><br></blockquote></div><br><br clear="all"><br>-- <br>Rashed