eigenvivek / DiffPose

[CVPR 2024] Intraoperative 2D/3D registration via differentiable X-ray rendering
http://vivekg.dev/DiffPose/
MIT License
118 stars 14 forks source link

What does mean the subsample? #34

Closed ryukyungjoon closed 3 months ago

ryukyungjoon commented 3 months ago

Can you tell me what the subsample value means? Is it related to fov? What are the values of delx and dely? I think it can be a key to solving the problem I'm facing now.

image

Thank you.

eigenvivek commented 3 months ago

subsample is merely the factor by which you downsample (if subsample > 1) an image.

For example, if the original X-ray is 100 x 100 pixels with 1 mm isotropic pixel spacing and you apply a factor of subsample=2, the new image will be 50 x 50 pixels with 2 mm isotropic pixel spacings.

Because pixel size and spacing are inversely scaled by subsample, the FOV actually remains constant.

ryukyungjoon commented 3 months ago

Thank you for answer. So, what do you mean by the constant values you used to calculate the subsample and delx variables?

subsample = (1536 - 100) / height delx = 0.194 * subsample

what does mean the 1536? , 100? and 0.194?

Thank you.

eigenvivek commented 3 months ago

1536 is the pixel dimension of the original image (it's square)

100 is subtracted because a 50 pixel edge is cropped to remove the effect of the collimator

height is the desired dimension of the image we want to render (256 for all diffpose experiments)

0.194 is the pixel size in the deepfluoro dataset

ryukyungjoon commented 3 months ago

Thank you for answer.

My dataset got 0.337890625 for pixel spacing from the dicom original volume, and set the desired detector size to 285, which is the same as the original DRR size. The pixel dimension was set to 512 which is the size of a single dicom file.

image isocenter pose DRR image

000 True DRR image

By the way, the result is shown in the image below. Additionally, I'm using APview's DRR, just to say if it will help me get an answer.

eigenvivek commented 3 months ago

HI @ryukyungjoon , it looks like your first DRR has anisotropic spacing. Are you setting delx and dely separately?

ryukyungjoon commented 3 months ago

Hi Vivek, Thank you for answering The problem I had was that the original volume was resampled and DRR was generated abnormally. Thanks to your advice, thank you so much and I hope you have a great day :)

eigenvivek commented 3 months ago

great glad to hear your issue was solved!