rpomponio / neuroHarmonize

Harmonization tools for multi-site neuroimaging analysis. Implemented as a python package. Harmonization of MRI, sMRI, dMRI, fMRI variables with support for NIFTI images. Complements the work in Neuroimage by Pomponio et al. (2019).
https://pypi.org/project/neuroHarmonize/
MIT License
79 stars 28 forks source link

NIFTI output after harmonization #49

Closed rahulharikumarr closed 2 months ago

rahulharikumarr commented 2 months ago

Hello @rpomponio

I have been looking at the results after using the ApplyModelNIFTIs function and I observed that after harmonization, there seems to be holes in the original images. Is this normal?

I am attaching examples of it below:

Before harmonization:

Screenshot 2024-06-17 at 12 10 04 PM

After harmonization:

Screenshot 2024-06-17 at 12 10 11 PM
rpomponio commented 2 months ago

No, it doesn't look normal to me. But we'll need more information to diagnose this.

Are the voxel intensities zero in the areas you describe as holes? Or are the voxel intensities just very low (i.e., near-zero)?

Also, the software you are using to view the images might be restricting the range of intensities in some way. Please check that to make sure what you are seeing is the full intensity spectrum (e.g., absolute minimum to absolute maximum voxel intensity).

rahulharikumarr commented 2 months ago

Sure! The voxel intensities are actually negative in the regions where I see the holes. And the intensity range is set to be the same for unharmonized and harmonized images in the software I am using.

rpomponio commented 2 months ago

That's very strange; I don't think negative voxel intensity makes any sense (correct me if I'm wrong).

I'm flagging this as related to #6 because it would be most useful to visualize the location/scale effects in the image space.

I suspect that the location effect for the site in question is negative and thus bringing down the intensities of the voxels in the middle of the brain. I don't know why this is happening.

If you are able to, I think it would be helpful to see some basic descriptive statistics, such as:

Site Number of images Age range Average voxel intensity
A XX 18 - 24 357.00
B YY 23 - 56 256.00
... ... ... ...
rahulharikumarr commented 2 months ago

Okay, I will look into that. Thank you for the help.

esther1262 commented 2 months ago

Hi @rpomponio

If we normalize the voxel first e.g. using z score normalization, wouldn't some voxel values become negative?

Thanks

That's very strange; I don't think negative voxel intensity makes any sense (correct me if I'm wrong).

I'm flagging this as related to #6 because it would be most useful to visualize the location/scale effects in the image space.

I suspect that the location effect for the site in question is negative and thus bringing down the intensities of the voxels in the middle of the brain. I don't know why this is happening.

If you are able to, I think it would be helpful to see some basic descriptive statistics, such as: Site Number of images Age range Average voxel intensity A XX 18 - 24 357.00 B YY 23 - 56 256.00 ... ... ... ...

rpomponio commented 2 months ago

Yes, you are correct. When you perform a z-score transformation, many voxels should have negative values as a result.

I'm not sure that z-scoring before harmonization makes much sense to me, and either way it is beyond the scope of this package. The ability to work with NIFTI files is mainly a convenience function, and is not the primary focus of the original paper[^1] on the topic of large-scale harmonization.

All that said, the harmonization of NIFTI files seems to be a hot topic and I would be genuinely curious in your results & the performance of neuroHarmonize versus alternatives.

[^1]: Pomponio, R., Shou, H., Davatzikos, C., et al., (2019). "Harmonization of large MRI datasets for the analysis of brain imaging patterns throughout the lifespan." Neuroimage 208. https://doi.org/10.1016/j.neuroimage.2019.116450.