Skip to content

Fix raw label loading for dotted paths - #6

Open
NimaAsh wants to merge 1 commit into
MedARC-AI:mainfrom
NimaAsh:nima/fix-raw-label-dot-path
Open

Fix raw label loading for dotted paths#6
NimaAsh wants to merge 1 commit into
MedARC-AI:mainfrom
NimaAsh:nima/fix-raw-label-dot-path

Conversation

@NimaAsh

@NimaAsh NimaAsh commented May 27, 2026

Copy link
Copy Markdown

Segmentation test failed on cluster paths like /data/nima.ashjaee/... because read_file_to_nifti_or_np misparsed the extension. This loads .nii/.nii.gz raw labels directly with nibabel before falling back to gardening_tools

@CLAassistant

CLAassistant commented May 27, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@lukasugar lukasugar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I suggest putting a comment in the code, that's all.

Thanks a lot!

# source label is the label from the original dataset without any preprocessing
src_label_path = file.replace(get_data_path(), get_source_labels_path()).replace(".pt", "_label.nii.gz")
src_label_nii = read_file_to_nifti_or_np(src_label_path)
if src_label_path.endswith((".nii", ".nii.gz")):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can you please put a comment in code explaining why this is added?
E.g. just "# read_file_to_nifti_or_np fails with dotted paths, e.g. /path/name.surmane/..., this is a quickfix

You explain it in the the PR description, but a comment would make it obvious for anyone looking at the code in the future

Comment thread asparagus/modules/datasets/TrainDataset.py
@NimaAsh
NimaAsh force-pushed the nima/fix-raw-label-dot-path branch from e43a3b7 to d853b4a Compare May 27, 2026 19:56
@NimaAsh

NimaAsh commented May 27, 2026

Copy link
Copy Markdown
Author

Yep, that was it. I had committed this from the cluster with a cluster email, so the CLA bot didn’t recognize me. I added the comment you requested, amended the commit with my GitHub email, and force-pushed the branch.

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

Successfully merging this pull request may close these issues.

3 participants