Skip to content

Commit

Permalink
fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jithenece committed Jul 31, 2024
1 parent 2acda92 commit c1b29fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
19 changes: 10 additions & 9 deletions models/bamf_mr_brain_tumor/dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
FROM mhubai/base:latest AS base
FROM base AS builder
FROM mhubai/base:latest

ENV DEBIAN_FRONTEND "noninteractive"
ENV LANG "en_GB.UTF-8"
Expand Down Expand Up @@ -52,14 +51,15 @@ LD_LIBRARY_PATH="/opt/ants/lib:$LD_LIBRARY_PATH" FREESURFER_HOME="/freesurfer"
# https://github.com/MIC-DKFZ/nnUNet/pull/1209
ENV SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True

# Install nnunetv2 and surfa
RUN pip3 install --no-cache-dir nnunetv2==2.0 surfa==0.6

WORKDIR /app
# Install nnunet and surfa
RUN pip3 install --no-cache-dir surfa==0.6
RUN apt-get update && apt-get install -y python3.9 python3-pip && apt-get clean && rm -rf /var/lib/apt/lists/*
RUN python3.9 -m pip install nnunetv2==2.4.1
RUN apt-get update && apt-get install -y bc

# Clone the main branch of MHubAI/models
ARG MHUB_MODELS_REPO
RUN buildutils/import_mhub_model.sh bamf_mr_brain_tumor ${MHUB_MODELS_REPO}
# ARG MHUB_MODELS_REPO
# RUN buildutils/import_mhub_model.sh bamf_nnunet_mr_brain ${MHUB_MODELS_REPO}

# Pull nnUNet model weights into the container for Dataset009_Breast
ENV WEIGHTS_DIR=/root/.nnunet/nnUNet_models/
Expand All @@ -73,6 +73,7 @@ RUN rm ${WEIGHTS_DIR}${WEIGHTS_FN}
# specify nnunet specific environment variables
ENV WEIGHTS_FOLDER=$WEIGHTS_DIR

WORKDIR /app
# Default run script
ENTRYPOINT ["mhub.run"]
CMD ["--config", "/app/models/bamf_mr_brain_tumor/config/default.yml"]
CMD ["--config", "/app/models/bamf_mr_brain_tumor/config/default.yml"]
3 changes: 2 additions & 1 deletion models/bamf_mr_brain_tumor/utils/BrainProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ def task(self, instance: Instance, in_t1_data: InstanceData, in_t1ce_data: Insta
flair = in_flair_data.abspath

output_dir = tempfile.mkdtemp()
self._setup(t1c, t1, t2, flair, output_dir)
self._setup(t1, t1c, t2, flair, output_dir)
self.v("running forward preprocessing....")
os.environ['nnUNet_results'] = os.environ['WEIGHTS_FOLDER']
self.forward_preprocess(predict=True)
Expand All @@ -439,3 +439,4 @@ def task(self, instance: Instance, in_t1_data: InstanceData, in_t1ce_data: Insta
shutil.copyfile(self.reverse_2[1], out_t1_data.abspath)
shutil.copyfile(self.reverse_2[2], out_t2_data.abspath)
shutil.copyfile(self.reverse_2[3], out_flair_data.abspath)

0 comments on commit c1b29fd

Please sign in to comment.