Skip to content

Commit

Permalink
Dicom extreaction and deformable reg (#59)
Browse files Browse the repository at this point in the history
* type hints, deprecated get_segmentation_connected_components

* remove the word centroids in text. Remove deprecated methods

* updated registation

* readme

* merge

* make it able to run on CPU

* update has_grid

* add deformable reg

* added poi reg and tests

* update test

* updated dicom_extractor and processing tutorial

* ruff

* ruff

* update tutorial

* updated tutorial

* ruff

---------

Co-authored-by: ga84mun <robert.graf@tum.de>
  • Loading branch information
robert-graf and ga84mun authored Nov 29, 2024
1 parent f37610f commit c146e97
Show file tree
Hide file tree
Showing 38 changed files with 3,065 additions and 632 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,6 @@ tmp/*
!/TPTBox/tests/sample_ct/*
poetry.lock
*.dcm
*.pkl
*.pkl
tutorials/*PixelPandemonium/*
tutorials/dataset-PixelPandemonium/*
101 changes: 101 additions & 0 deletions TPTBox/core/bids_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,105 @@
"R2star",
"radiomics",
"MPR", # Rapid gradient-echo (MP RAGE) sampling
"IRT",
"MES",
"MEGR",
"MP2RAG",
"MPM",
"MT",
"MT",
"T1map",
"T2map",
"T2starmap",
"R1map",
"R2map",
"R2starmap",
"PDmap",
"MTRmap",
"MTsat",
"UNIT1",
"T1rho",
"MWFmap",
"MTVmap",
"Chimap",
"S0map",
"M0ma",
"T1w",
"T2w",
"PDw",
"T2starw",
"FLAIR",
"inplaneT1",
"inplaneT2",
"PDT2",
"angio",
"T2star",
"FLASH",
"VF",
"defacemas",
"dw",
"TB1TFL",
"TB1RFM",
"RB1CO",
"TB1AF",
"TB1DA",
"TB1EP",
"TB1SRG",
"TB1ma",
"RB1ma",
"ep",
"phase1",
"phase2",
"magnitude1",
"magnitude2",
"magnitude",
"fieldma",
"phasedif",
"sbre",
"cb",
"bol",
"as",
"m0sca",
"aslcontex",
"asllabelin",
"phas",
"noR",
"ee",
"iee",
"sti",
"ME",
"channel",
"coordsyste",
"headshap",
"electrode",
"marker",
"me",
"sti",
"PE",
"bloo",
"pe",
"event",
"physio",
"sti",
"TEM",
"SEM",
"uCT",
"BF",
"DF",
"PC",
"DIC",
"FLUO",
"CONF",
"PLI",
"CARS",
"2PE",
"MPE",
"SR",
"NLO",
"OCT",
"SPIM",
"XPC",
"phot",
"stat",
"snp",
"log",
Expand All @@ -36,7 +135,9 @@
"angles",
"subvar",
"logit",
"localizer",
]
# https://bids-specification.readthedocs.io/en/stable/appendices/entity-table.html
formats_relaxed = [*formats, "t2", "t1", "t2c", "t1c", "cta", "mr", "snapshot", "t1dixon", "dwi"]
# Recommended writing style: T1c, T2c; This list is not official and can be extended.

Expand Down
7 changes: 3 additions & 4 deletions TPTBox/core/bids_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ def get_changed_path( # noqa: C901
auto_add_run_id=False,
additional_folder: str | None = None,
dataset_path: str | None = None,
make_parent=True,
make_parent=False,
no_sorting_mode: bool = False,
non_strict_mode: bool = False,
) -> Path:
Expand Down Expand Up @@ -1192,9 +1192,8 @@ def filter_non_existence(

def filter_dixon_only_inphase(self):
def json_filter(x):
return (
"ImageType" not in x
or "W" not in x["ImageType"]
return "ImageType" not in x or (
"W" not in x["ImageType"]
and "F" not in x["ImageType"]
and "FAT" not in x["ImageType"]
and "WATER" not in x["ImageType"]
Expand Down
Loading

0 comments on commit c146e97

Please sign in to comment.