首页>itarticle>applying gpu in demons registration by using itk library Read image file GPU registration Output
applying gpu in demons registration by using itk library Read image file GPU registration Output
admin11月 13, 20200
I currently process CBCT image, mainly focusing on reconstruction. I use ITK as motion estimation tool. And to accelerate the calculation procedure, I also use GPU part in ITK
Read image file
My files are stored as raw binary format.Since ITK does not provide the raw bin file reader, I have to convert them to itk::Image type by my own. Luckily, ITK provides ImportImageFilter class to import data from a standard C array into an itk::Image.
image file
For image file, each voxel has one float number representing attenuation coefficient.
Then the output of FixedImportFilter is image of ITK type built from the source binary file.
DVF file
For DVF file, each voxel has three float numbers representing movements in three directions. So I have to combine them into a vector form. In this part I use ComposeImageFilter class
Then the output of DVFImportFilter is image of ITK type which is image of verctors.
different types of vector images
– VectorImage : Each pixel represents k measurements, each of datatype TPixel. The memory organization of the resulting image is as follows: … Pi0 Pi1 Pi2 Pi3 P(i+1)0 P(i+1)1 P(i+1)2 P(i+1)3 P(i+2)0 … where Pi0 represents the 0th measurement of the pixel at index i. Conceptually, a VectorImage< TPixel, 3 > is the same as a Image< VariableLengthVector< TPixel >, 3 >. The difference lies in the memory organization. The latter results in a fragmented organization with each location in the Image holding a pointer to an VariableLengthVector holding the actual pixel. The former stores the k pixels instead of a pointer reference, which apart from avoiding fragmentation of memory also avoids storing a 8 bytes of pointer reference for each pixel. The parameter k can be set using SetVectorLength.
GPU registration
In order to accelerate the calculation, it is best to use GPU.
Convert CPUImage to GPUImage
I use CastImageFilter to convert CPUImage to GPUImage
近期评论