I vtkSmartPointermyCamera = vtkSmartPointer::New();
myCamera->SetFocalPoint(212, 212, 148);//
myCamera->SetViewUp(0, 0, -1);
now I use these functions to set camera that can see from the front of image, but I want to see from the back of image. I tried to modify position parameter, but it doesn’t work at all.
how can I set the camera?
I vtkSmartPointermyCamera = vtkSmartPointer::New();
Are you sure that your clipping range is correct? I would recommend to reset the camera clipping range after you’ve set up its position and added all actors to the renderer.
the real range are (858,1845)
now I want to set the camera to the back. so I reset the camera position at the opposite direction. and it doesn’t work.
Do you mean that when I reset the position, I should reset the cliprange?then what value I will set for cliprange?
thanks a lot
Instead of setting clipping range manually, I would recommend to reset the camera clipping range after you’ve set up the camera position and focal point and added all actors to the renderer. It does not matter what was the clipping range before the reset.
In fact, the actor is a image got by reslice(see the image below, the red circle), at first, I didn’t set the camera and use the default camera. but I want to exchange the image’s left and right, so I think, if I reset the camera to the opposite direction, then the image just meet my idea. but when I reset the camera parameter, I found it didn’t work at all.
image1 is the source image, look at the right top view, the green circle is on the left, I want to get the result as image2
Sorry, I cannot help you with this any further. This question (and most other questions that you have asked in the past few months) have been already answered, implemented, tested, and provided for free in several open-source medical image viewers. It would be much better use of your and the community member’s time if you built your application by extending an existing software and focus your attention to problems that have not been already solved.
I am confused by what your said. I can explore other open-source medical image viewers, but that doesn’t effect I research vtk. In fact, you can take this question as a common question focus on how to use a camera, it has no any links with medical.maybe I need other industry image.
There are good application frameworks for other domains, too (for example, you can use ParaView for general engineering applications).
hi, Andras Lasso,
thank you for your advice. but the other application frameworks can’t solve my confusion.
the first question, why some situations, setting the camera parameter are useful, and with some situations, the setting of camera don’t work at all.
for example, I have a vtkRenderer and vtkRenderWindow, which has some actors, created by other persons, when I try to reset the camera, it doesn’t work except SetViewUp() function. but if I get the actors from the vtkRenderer and added them to another vtkRenderer, all the camera setting are ok.
another example,I reset the actor with SetUserTransform() function, and I can get the new position value after setting.the x,y,z value have change. But the display of vtkRenderer has no changes.
I think it must exist some questions I don’t know.
In fact, I don’t care which industry or any frameworks. I don’t develop any products. I am just researching the vtk itself.
Actually, you need to care about this. VTK feature development and community support is paid for by specific industries and VTK-based frameworks. Even if your question is valid, if you cannot demonstrate that it is relevant or helpful for any of these sponsored groups then it is less likely that anyone can allocate time to answer it. There is no established rules for this, it is just my theory of why the response rate on VTK forum is relatively low.
This theory would explain why forums that are more focused on a particular industry or framework have higher response rate. For example, VTK-based 3D Slicer has about 5x more traffic than the general VTK forum but there all the questions are answered, even if the question related to usage of VTK, ITK, numpy, or any other underlying library (of course the answers will describe how to achieve your goals within that framework).
oh, so that is what it is. I see.thank you very much.
can you give me a link for other forum?
That is my theory at least.
If you mean the 3D Slicer forum, it’s here: https://discourse.slicer.org/
Note that if you ask how to do something you’ll get answer about how to do it using not just plain VTK but all the other tools available in Slicer.
Hey pingdan, I’m with you on this. VTK has a huge learning curve and I’m currently tackling with my volumes being displayed upside down. Do i use a combination of camera too, pitch and yaw to put it in the orientation that I want? I think you have to become really great at searching the open source code.
May I ask though, would you be kind snout the share the code that produced that orthogonal slice triangulation? You display it in that first picture consisting of axial, sagittal and coronal slices. Where can I find that code? Thanks.
you can give me a email. and after reorganize, I can send you email.
Thanks so much!!! my email in firstname.lastname@example.org