Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reversed order for subtraction and division for math binary operation #2

Open
jilei-hao opened this issue Dec 6, 2023 · 1 comment

Comments

@jilei-hao
Copy link
Owner

jilei-hao commented Dec 6, 2023

Dear Jilei,

I hope this message finds you well. I encountered a technical issue while attempting to post my message on the forum website (itksnap-users), and despite several attempts, I was unable to resolve the matter.

As per the guidelines and protocol, I understand the importance of communicating through the forum. However, due to the unforeseen circumstances, I am reaching out to you directly via email to ensure that my message does not go unnoticed.

Dear Jilei, I am writing to report an unexpected behavior I encountered while using the -divide command in c3d. According to the documentation, the -divide command should perform element-wise division of two images. However, when I attempted to divide Inphase.nii by opposite_phase.nii using the following command:

Inphase.nii opposite_phase.nii -divide -o ratio.nii

The resulting pixel values in ratio.nii were equal to the ratio of opposite_phase.nii to Inphase.nii, rather than the expected ratio of Inphase.nii to opposite_phase.nii. This unexpected behavior contradicts the documentation and makes it difficult to perform the desired arithmetic operation.

I have carefully reviewed the c3d manual guide to ensure that I am using the -divide command correctly. The documentation clearly states that the command should perform element-wise division of two images, yet the actual behavior is the opposite.

To reproduce this issue, please follow these steps:

  1. Download two images, Inphase.nii and opposite_phase.nii.

  2. Execute the following command:
    c3d Inphase.nii opposite_phase.nii -divide -o ratio.nii

  3. Inspect the resulting image, ratio.nii, and verify that the pixel values are equal to the ratio of opposite_phase.nii to Inphase.nii.

I have included the images mentioned in this message for your consideration.

Best Regards, Mohammad

@jilei-hao
Copy link
Owner Author

c3d-divide-issue.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant