gml16 / rl-medical

Communicative Multiagent Deep Reinforcement Learning for Anatomical Landmark Detection using PyTorch.
https://arxiv.org/abs/2008.08055
Apache License 2.0
79 stars 21 forks source link

How to generate landmarks to txt files? #2

Closed li-pengcheng closed 3 years ago

li-pengcheng commented 3 years ago

could you please tell me how to generate the landmarks to txt files? For example, in ADNI_002_S_0816_MR_MPR__GradWarp__B1_Correction__N3__Scaled_Br_20070217005829488_S18402_I40731.txt,how to explain the first line 86,86,84? Is this the corresponding to the physical coordinate in the CT image?

gml16 commented 3 years ago

The txt files are the true labels of the landmarks' locations (annotated by expert clinicians). So yes in your example 86,86,84 corresponds to the x, y and z coordinates respectively of the first landmark within the corresponding .nii.gz medical image. Each line in the text file is another landmark. Those coordinates directly translate to the actual physical coordinates. For those images, voxels are spaced by 1mm in the actual brain. Additionally, the data of a Nifti image is represented as a numpy 3D array. Does this answer your questions?

li-pengcheng commented 3 years ago

Yes. Thanks for your rapid reply!

Vathsan commented 1 year ago

Hi @gml16, should the coordinates system be actual physical coordinates (x, y, z)? Is it possible to use RAS/LPS coordinates for the landmarks and train the model? I was wondering if having positive and negative values would lead to any issues.

You may refer to the following screenshot for an example, coordinates

gml16 commented 1 year ago

Hi Vathsan, the image reader is delegated to SimpleITK. I believe negative coordinates should have no negative impact. Please feel free to try and let me know.

If it doesn’t work you are more than welcome to submit a PR to handle this case. The file dataReader.py handles loading the images using SimpleITK. (Sorry for the low code quality of this file.)

Hope that helps, let me know if anything is unclear. :)

Vathsan commented 1 year ago

Thanks, I'll try and see if it works.