I have some medical images, saved as .nrrd files. (segmented)
I would like to calculate the centroid for each slice along a single axis. (Entire segmnet is currently aligned)
Then create a line of best fit for this.
Any suggestions for this please,(I am very much a beginner and not of engineering background.)
Alternatively if I can export single slices as .png I think there is some function in matlab to do that. I am not sure how to export png files each slice. I use Mac with Mac OS 11.
You can get the segmentation as a 3D voxel array and access each slice using indexing. But most likely you will not need to deal with such low-level operations.
What is your overall goal? Would you like to extract the centerline of a segmented structure? Have you tried the VMTK extension for this or SegmentGeometry extensions?
Thanks @lassoan, I think segment geometry extension has it,
Yes, I would lilke to extract the centreline of the structure,
Based on centroid of every slice of the segmentation.
So I selcetd computations as centroid (screenshot), I think Cx and Cy is the x and y coordinates of the centroid for each slice. Is that correct?
But I place a fiducialmarker the possible centroid, on a particlar slice, I get different coordinates for the marker,
I think the module does what I want but I am not interpreting it correctly. Could you pls advice.
Also how can I draw a best fit line for the series of centroids pls