-
Notifications
You must be signed in to change notification settings - Fork 59
Add SWC female template mode support to WHS SD rat atlas script #716
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
base: main
Are you sure you want to change the base?
Conversation
- SWC Female Template mode (True): Uses SWC female rat template as reference, from GIN repository - Waxholm/NITRC mode (False): Original workflow using zip archives from NITRC - Refactor download functions, add `download_swc_template_file()` - Use `construct_meshes_from_annotation()` - Add reference stack normalization for SWC template mode (uint16 scaling) - Bump version to 3
|
Hi @viktorpm, I think it would be better for the code for this new atlas to be in it's own file. Although there's a lot of shared code with the "original" Waxholm, I think it would be easier to understand if they were seperated. |
|
I split the script into two separate files and had ChatGPT write the docstrings based on the code and my instructions. They both run and generate atlases. As expected in the Top left: Do you think this is an issue @adamltyson, @alessandrofelder? The atlases are available here: |
I think this is fine for the SWC template in Waxholm space (we will keep the SWC template in its own space, and 50 um (and maybe one day, at 25um) too, right?), as long as the metadata is updated accordingly. We have a convention that the atlas generation file matches the name of the atlas created by it, so maybe the new Python file needs renaming to just |
|
I think it's fine, but ideally we would create a new 39um version in Waxholm space from a 25um version in SWC space to minimise loss of information. |
| REFERENCE_URL = ( | ||
| "https://gin.g-node.org/BrainGlobe/swc_rat_atlas_materials/" | ||
| "raw/master/packaging/50um/Waxholm_space/T2W_warped.nii.gz" | ||
| ) | ||
| ANNOTATION_FILENAME = "WHS_SD_annotation_waxholm_space_cleaned.nii.gz" | ||
| ANNOTATION_URL = ( | ||
| "https://gin.g-node.org/BrainGlobe/swc_rat_atlas_materials/" | ||
| "raw/master/packaging/50um/Waxholm_space/" | ||
| "WHS_SD_annotation_waxholm_space_cleaned.nii.gz" | ||
| ) | ||
| STRUCTURES_ILF_FILENAME = "WHS_SD_rat_atlas_v4.01_labels.ilf" | ||
| STRUCTURES_ILF_URL = ( | ||
| "https://gin.g-node.org/BrainGlobe/swc_rat_atlas_materials/" | ||
| "raw/master/packaging/50um/WHS_SD_rat_atlas_v4.01_labels.ilf" | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit confusing that these files refer to "50um", but they should be 39um right?
| ATLAS_PACKAGER = ( | ||
| "Harry Carey, University of Oslo, Norway, [email protected]" | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one should be you @viktorpm!
|
Hmm why 50 and not just 39, may as well align with the Waxholm. Good job with this! |
Just because it was created at 50, but a version has been upsampled (and warped) to match the Waxholm. A 25um version is in the works. |
|
sure, the resolutions are arbitrary, just wondering. 25um sounds good, how possible is 10um? I think it would be the first cellular resolution atlas for the Rat brain. |
|
Possible I think (@viktorpm the original data is at least 10um isotropic right?). The issue is time, as it would be 5^3 times slower than the 50um version. |
|
Which part would be so slow, the template creation or registration? the registration we could just upsample a 39um deformation field. Maybe something for down the line. |
|
The template creation for the 25 micron, with our current set-up (which parallelises registrations across samples) takes several weeks to a month... 10 micron is expected to take more than 8 times that. |
|
I see, that does sound a little prohibitive |
|
The original data is anisotropic and has a resolution below 10 µm. In theory, we could probably go up to around 7 µm. @PolarBean, the template creation would be the slow part and I’m not entirely sure whether the cluster could handle anything above 20 µm (that’s the highest resolution that’s been tested so far). |

Description
What is this PR
Why is this PR needed?
To support generating the WHS SD rat atlas using the SWC female rat template as the reference image, in addition to the existing Waxholm/NITRC workflow.
What does this PR do?
swc_female_templateflag:construct_meshes_from_annotation()How has this PR been tested?
It was run interactively on an HPC node
Is this a breaking change?
no
Does this PR require an update to the documentation?
Likely
Checklist: