Creating a 3D Object Topic
The Medical3DObject is a class that is used to hold the properties and methods of the 3D object as well as the images (slices) that will make up the 3D object.
In order to create a 3D object, you must:
- Create an instance of this class (Medical3DObject) and
- Add the created instance to the Medical3DContainerobjects collection.
- Fill the Medical3DObject class with image slices either through the Medical3DObject.Image property or the Medical3DObject.SetImage method, or through the memory efficient load method (recommended) which is explained below.
- Once the slices are added, you can then render the object using the Medical3DContainer.Render method.
Filling the 3D object with image (slices)
There are multiple ways to add the images to the 3D object, each having its own advantages.
- Using the Medical3DObject.Image property - the passed image must be a multi frame image with more than 3 pages. This is simple and fast, but not recommended for slice collections that require huge amounts of memory.
- Using the Medical3DObject.SetImage method - the passed image must be a multi frame image with more than 3 pages. This is simple and fast, and the toolkit will free the image after creating the 3D object. This method is also not recommended for slice collections that require huge amounts of memory.
Using the Medical3DObject.MemoryEfficientInit method - using the memory efficiency method allows for optimal loading of a 3D object that requires a huge amount of memory to be allocated. The recommended way (which is faster and more memory efficient) to populate the 3D Object with image slices, is to pass the Medical3Dobject instance as a parameter to the Medical3DControl constructor. The Medical3DControl will create a Medical3DContainer internally and add the Medical3DObject to it, and after filling the 3D object with the images (slices), the control will handle rendering the object automatically.
To use this method, you must:
Call Medical3DObject.MemoryEfficentInit: This will create an empty 3D object which will receive all of the loaded frames.
Add each individual image frame using MemoryEfficientSetFrame by passing the frame along with the index of the frame (to indicate where to place it in the 3D object). Keep in mind that you will need to free each frame after each MemoryEfficientSetFrame call, in order to release the memory used by the original image frame.
There are four overloads for MemoryEfficientSetFrame. They specify the method that will be used to sort the images in order to build the 3D object correctly. Users can sort the images based on their image position, capture time, instance number; or keep them unsorted.
- Call Medical3DObject.MemoryEfficientEnd to wrap up the 3D object creation.