To begin with, we need to include a couple of basic libraries: import numpy as np Well, let's start 🤖 Show me the codeeee!! Then, the idea is to transform the values of the matrix into a range 0-255. Particularly, the volume represents a CT composes of values in Hounsfield Unit. In my context, the 3D matrix is a volume of dimensions w * h * d, and the image has a dimension of w * h. The problem might be summarized as: given a 3D matrix of real values, extract grayscale images which represent a section of this matrix. Those work are suitably for my purposes 🤓
I know there are others and maybe better ones. Then, I discovered there were several options to achieve that. This week I have been working on extracting images from a 3D matrix to be displayed.