centroid for each slice along one axis in a .nrrd file

1 回表示 (過去 30 日間)
Mel A
Mel A 2023 年 3 月 28 日
コメント済み: Ergin Sezgin 2023 年 3 月 30 日
Hi All
I have some medical images, saved as .nrrd files. (segmented)
I would like to calculate the centroid for each slice along a single axis.
Then create a line of best fit for this.
Any suggestions for this please,(I am very much a beginner in matlab and not of engineering background.)
Thanks heaps

採用された回答

Ergin Sezgin
Ergin Sezgin 2023 年 3 月 28 日
Hey,
You can isolate the layers, binarize them with imbinarize function, manipulate the regions by morphology if necessary, and then get the region properties by regionprops function. This will yield the centroid data for each region. Then you can extract centroids into an array and fit a line in 3D space using these values.
Good luck.
  6 件のコメント
Mel A
Mel A 2023 年 3 月 30 日
Thanks so much,
This worked,
Now my problem is converting this to mm/ world coordinates rather than pixels.
I get the line I want but I cant align it on my STL model created with the same exact .nrrd file. I think the problem is that the numbers in the centroid array are in pixels/voxels.
Please let me know if you a way for this
I am currently reading and trying, will update if I can work this out.
Ergin Sezgin
Ergin Sezgin 2023 年 3 月 30 日
Hey Mel,
I'm glad that it worked.
Normally, I use calibration plates and tools such as a checkerboard plates to compute intrinsic parameters which enable me to get distortion free images. Knowing the real size of checkerboard squares and getting an image of the board, it is possible to get an analytical relation between real world dimensions and pixels. This is useful for 2D data. For the third dimension along Z axis, you need some kind of encoder. You can assume every layer has an equal distance between each other or you can get real, precise distances between layers from the hardware you use to get .nrrd data.
I hope this helps
Good luck

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by