Skip to content

Commit

Permalink
Merge pull request #43 from spirosmaggioros/main
Browse files Browse the repository at this point in the history
Fixed pre-commit
  • Loading branch information
spirosmaggioros authored Oct 11, 2024
2 parents 692067c + cbe2b79 commit b14ad71
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.8"
python-version: "3.12"
- run: pip3 install pre-commit
- run: pre-commit run --files NiChart_DLMUSE/*
16 changes: 12 additions & 4 deletions NiChart_DLMUSE/SegmentImage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@


def run_dlicv(
in_dir: str, in_suff: Any, out_dir: str, out_suff: Any, device: str,
extra_args: str = ""
in_dir: str,
in_suff: Any,
out_dir: str,
out_suff: Any,
device: str,
extra_args: str = "",
) -> None:
# Call DLICV
print("Running DLICV")
Expand All @@ -19,8 +23,12 @@ def run_dlicv(


def run_dlmuse(
in_dir: str, in_suff: Any, out_dir: str, out_suff: Any, device: str,
extra_args: str = ""
in_dir: str,
in_suff: Any,
out_dir: str,
out_suff: Any,
device: str,
extra_args: str = "",
) -> None:
# Call DLMUSE
print("Running DLMUSE")
Expand Down
10 changes: 8 additions & 2 deletions NiChart_DLMUSE/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,14 @@ def main() -> None:
for i in range(len(subfolders)):
curr_out_dir = out_dir + f"/split_{i}"
curr_thread = threading.Thread(
target=run_pipeline, args=(subfolders[i], curr_out_dir, device, dlmuse_extra_args, dlicv_extra_args)
target=run_pipeline,
args=(
subfolders[i],
curr_out_dir,
device,
dlmuse_extra_args,
dlicv_extra_args,
),
)
curr_thread.start()
threads.append(curr_thread)
Expand All @@ -157,6 +164,5 @@ def main() -> None:
remove_subfolders(in_data)



if __name__ == "__main__":
main()
33 changes: 21 additions & 12 deletions NiChart_DLMUSE/dlmuse_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
from pathlib import Path
import pkg_resources

import pkg_resources # type: ignore

from .CalcROIVol import apply_create_roi_csv, combine_roi_csv
from .MaskImage import apply_combine_masks, apply_mask_img
Expand All @@ -25,28 +25,37 @@
# "dicts",
# "MUSE_mapping_consecutive_indices.csv",
# )
#DICT_MUSE_NNUNET_MAP = os.path.join(
# DICT_MUSE_NNUNET_MAP = os.path.join(
# Path(__file__).parent.parent,
# "shared",
# "dicts",
# "MUSE_mapping_consecutive_indices.csv",
#)
DICT_MUSE_NNUNET_MAP = pkg_resources.resource_filename('NiChart_DLMUSE',
'shared/dicts/MUSE_mapping_consecutive_indices.csv')
# )
DICT_MUSE_NNUNET_MAP = pkg_resources.resource_filename(
"NiChart_DLMUSE", "shared/dicts/MUSE_mapping_consecutive_indices.csv"
)
LABEL_FROM = "IndexConsecutive"
LABEL_TO = "IndexMUSE"

DICT_MUSE_SINGLE = DICT_MUSE_NNUNET_MAP
# DICT_MUSE_DERIVED = os.path.join(
# os.path.dirname(os.getcwd()), "shared", "dicts", "MUSE_mapping_derived_rois.csv"
# )
#DICT_MUSE_DERIVED = os.path.join(
# DICT_MUSE_DERIVED = os.path.join(
# Path(__file__).parent.parent, "shared", "dicts", "MUSE_mapping_derived_rois.csv"
#)
DICT_MUSE_DERIVED = pkg_resources.resource_filename('NiChart_DLMUSE',
'shared/dicts/MUSE_mapping_derived_rois.csv')

def run_pipeline(in_data: str, out_dir: str, device: str, dlmuse_extra_args: str, dlicv_extra_args: str) -> None:
# )
DICT_MUSE_DERIVED = pkg_resources.resource_filename(
"NiChart_DLMUSE", "shared/dicts/MUSE_mapping_derived_rois.csv"
)


def run_pipeline(
in_data: str,
out_dir: str,
device: str,
dlmuse_extra_args: str,
dlicv_extra_args: str,
) -> None:
"""
NiChart pipeline
"""
Expand Down

0 comments on commit b14ad71

Please sign in to comment.