Use ITK And VTK To Show DICOM Image
Environment: VTK8.2.0, ITK5.0.0 Here is a demo project to display DICOM data by ITK and VTK. CMakeLists.txt main.cpp The folder contains a series of dcm files.Run it. Convert it to RGBA Image crudely.
Environment: VTK8.2.0, ITK5.0.0 Here is a demo project to display DICOM data by ITK and VTK. CMakeLists.txt main.cpp The folder contains a series of dcm files.Run it. Convert it to RGBA Image crudely.
Make canvas response to key press event We often create our custom iteractor style object to define our interactive behaviors.Write some debug code in OnKeyPress event.For web page, the element canvas is like Qt’s widget. Set property tabindex for responsing to user key press event. Asynchronous call It’s synchronous for JS code call wasm Read more…
The post shows how to use difference matrix to let two camera have same action. We can get the following relationship between viewUp vector and view plane normal. The view transform matrix can be generated from camera focal point, postion and view up vector. Matrix of camera’s view transform: Read more…
Set An Image As Render Background std::string bgImgPath = “./resource/bg.png”; vtkNew<vtkPNGReader> imgReader; imgReader->SetFileName(bgImgPath.c_str()); vtkNew<vtkTexture> backgroundTexture; backgroundTexture->SetInputConnection(imgReader->GetOutputPort()); m_Renderer->GradientBackgroundOff(); backgroundTexture->Update(); m_Renderer->SetBackgroundTexture(backgroundTexture); m_Renderer->SetTexturedBackground(true); Save 3D Model Screen Shot With Transparent Background Don’t set textured background for renderer object. Then set alpha bits for renderer window object, read RGBA information from back buffer when Read more…
I’m assuming we’re using a parallel projection for 3D environment. We can find the project transform matrix logic at VTK code source. The ParallelScale is bigger, xmax – xmin and ymax – ymin is bigger, matrix[0][0] and matrix[1][1] is smaller. So we can get that the display length of model Read more…
PreserveColorBuffer You can see the following effect after preserving color buffer for renderer object. Download 3D Model With WASM From Web Pabge The browser will download the VTP file automatically when your web page run to the above logic.
We will show how to move 3D cone display scene in two different canvases on the same tab page with VTK WebAssembly project. Let’s define two canvas on the page. One is at the left-top area, the other is at the right-top part. It will change canvas binding with wasm Read more…
I got the following error information on the web page if I change the id of canvas to be ‘canvas1’. The function USDL2OpenGLRenderWindow::CreateAWindow is similar to vtkSDL2OpenGLRenderWindow::CreateAWindow. We can read VTK and SDL library source code and find these code snippets. File: video\emscripten\SDL_emscriptenvideo.c device->CreateSDLWindow = Emscripten_CreateWindow; static int Emscripten_CreateWindow(_THIS, SDL_Window Read more…
Question 1, Given a triangle, what are the three adjacent triangles? Question 2, Given an edge, which two triangles share it? Question 3, Given a vertex, which faces share it? Question 4, Given a vertex, which edges share it? A video about the post: Bilibili