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

Resample all histological images to 0.2x0.2x0.5 resolution #9

Merged
merged 1 commit into from
Apr 3, 2023

Conversation

valosekj
Copy link
Member

@valosekj valosekj commented Mar 28, 2023

Description

This PR updates histological atlas to 0.2x0.2x0.5 resolution.

Note: The real resolution is 0.199074x0.198795x0.5 due to rounding. Context: spinalcordtoolbox/spinalcordtoolbox#4077

Resulting dim and pixdim for all histological images:

valosek@macbook-pro:~/code/PAM50/histology$ for file in *.gz;do echo ${file};sct_image -i ${file} -header | grep dim | head -3;echo "";done
PAM50_200um_AVF.nii.gz
dim		[3, 108, 83, 205, 1, 1, 1, 1]
pixdim		[-1.0, 0.199074, 0.198795, 0.5, 0.0, 0.0, 0.0, 0.0]
phase_dim	0

PAM50_200um_Eccentricity.nii.gz
dim		[3, 108, 83, 205, 1, 1, 1, 1]
pixdim		[-1.0, 0.199074, 0.198795, 0.5, 0.0, 0.0, 0.0, 0.0]
phase_dim	0

PAM50_200um_EquivDiameter.nii.gz
dim		[3, 108, 83, 205, 1, 1, 1, 1]
pixdim		[-1.0, 0.199074, 0.198795, 0.5, 0.0, 0.0, 0.0, 0.0]
phase_dim	0

PAM50_200um_EquivDiameter14.nii.gz
dim		[3, 108, 83, 205, 1, 1, 1, 1]
pixdim		[-1.0, 0.199074, 0.198795, 0.5, 0.0, 0.0, 0.0, 0.0]
phase_dim	0

PAM50_200um_EquivDiameter48.nii.gz
dim		[3, 108, 83, 205, 1, 1, 1, 1]
pixdim		[-1.0, 0.199074, 0.198795, 0.5, 0.0, 0.0, 0.0, 0.0]
phase_dim	0

PAM50_200um_MVF.nii.gz
dim		[3, 108, 83, 205, 1, 1, 1, 1]
pixdim		[-1.0, 0.199074, 0.198795, 0.5, 0.0, 0.0, 0.0, 0.0]
phase_dim	0

PAM50_200um_Naxons.nii.gz
dim		[3, 108, 83, 205, 1, 1, 1, 1]
pixdim		[-1.0, 0.199074, 0.198795, 0.5, 0.0, 0.0, 0.0, 0.0]
phase_dim	0

Note that a modified version of resampling.py was used to set img.header["pixdim"][4:] = 0; context here.

The size is 31M, which is under the 50M threshold proposed by Julien in #7.

valosek@macbook-pro:~/code/PAM50/histology$ du -h
 31M	.

Related issues/PRs

Fixes #7
Fixes #8

Note: The real resulting resolution is 0.199074x0.198795x0.5 due to rounding. Context: spinalcordtoolbox/spinalcordtoolbox#4077

Fixes: #8
Copy link
Member

@joshuacwnewton joshuacwnewton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the 2023-03-30 meeting, we discussed whether the 0.199074x0.198795x0.5 is acceptable. Due to the complicated nature of achieving exactly 0.2x0.2x0.5 resolution (see @mguaypaq's comment in spinalcordtoolbox/spinalcordtoolbox#4077 (comment)), we decided to stick with the slightly-off resolution for now.

The size is 31M

Additionally, since this PR greatly decreases the file size of each file, merging this PR will address #7 as well. So, I've updated the description to link that issue to this PR.

I think we're good to merge! 🎉

@joshuacwnewton joshuacwnewton marked this pull request as ready for review April 3, 2023 15:11
@joshuacwnewton joshuacwnewton merged commit e494681 into master Apr 3, 2023
@joshuacwnewton joshuacwnewton deleted the jv/8-unify_histology_atlas_dimensions branch April 3, 2023 15:27
joshuacwnewton pushed a commit that referenced this pull request May 19, 2023
Note: The real resulting resolution is 0.199074x0.198795x0.5 due to rounding. 

Context: spinalcordtoolbox/spinalcordtoolbox#4077
joshuacwnewton pushed a commit that referenced this pull request May 19, 2023
Note: The real resulting resolution is 0.199074x0.198795x0.5 due to rounding. 

Context: spinalcordtoolbox/spinalcordtoolbox#4077
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants