![]() Last but not least, I show how to get measurements of a roi which has an area. ![]() You can change all intensities or you can set a threshold (-99999 to 99999 in this example). Int curSlice = curImage] ĭCMPix *curPix = objectAtIndex: curSlice] This snippet of code will take the first ROI of the current image and change the intensity of all underlying pixels. LengthInCM += to: in Pixel=%2.5f Centimeter=%2.5f', LengthInPixel, LengthInCM) If you draw more than one ROI on sequential images you can calculate a volume in cubic centimeter (cm^3).įloat *ROIVolume = Get the area in square centimeter (cm^2). This is probably the most important stuff. But remember the movement has to be in pixels and is relative to the current position. As little extra I added a line of source code which can move the points of the line. How you find a roi was already covert in an other post. Now let’s find out the coordinates of a rectangle made by the user. NSMutableArray *roiImageList = curImage]] All rois contained in the current image All rois contained in the current series Keep in mind that the number of pixels included in a 200 mm^2 ROI is varying!ĭCMPix *firstPix = objectAtIndex:0] įloat PixelSpacingX = įloat PixelSpacingY = įloat WidthInPixel = WidthInMM / PixelSpacingX įloat HeightInPixel = HeightInMM / PixelSpacingY ![]() The following example will create a 20×10 mm rectangle ROI on the current image. So to keep this tutorial simple we assume that our pixels are squares! Problems start popping up when the width and height of a pixel are not the same. This looks easy, because it is… at least in theory. Length in Pixels = Length in Millimeter / PixelSpacing This size is always saved in the metadata of a dicom image. Therefor you have to know the size of a pixel (also known as pixel spacing). So if you would like to create a ROI exactly one centimeter in length you have to convert it in pixels first. That’s exactly how OsiriX wants its coordinates, in pixels. This tutorial covers how to create rectangle ROIs, finding the location of its points and finally how to calculate things like area, volume, perimeter, sum, mean etc.Īll images consist of pixels.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |