Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Oct 27, 2023
2 parents b776d1d + 29a4c61 commit 00cc0a4
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 4 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# warning: unofficial base image is not stable and may change in the future!
FROM docker.io/fnndsc/mni-conda-base:unofficial
FROM docker.io/fnndsc/pl-fetal-surface-extract:base-1

LABEL org.opencontainers.image.authors="Jennings Zhang <[email protected]>" \
org.opencontainers.image.title="pl-fetal-surface-extract" \
Expand Down
1 change: 1 addition & 0 deletions base/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
41 changes: 41 additions & 0 deletions base/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM docker.io/fnndsc/microminc-builder:latest as builder

RUN microminc.sh \
adapt_object_mesh \
dilate_volume \
minccalc \
mincchamfer \
mincdefrag \
mincresample \
mincreshape \
param2xfm \
sphere_mesh \
surface_mask2 \
transform_objects \
inflate_to_sphere_implicit \
inflate_to_sphere \
create_tetra \
print_n_polygons \
subdivide_polygons \
interpolate_sphere \
depth_potential \
vertstats_math \
volume_object_evaluate \
adapt_metric \
depth_potential \
/microminc

# perl libraries need to be copied manually
RUN cp -r /opt/CIVET/dist/perl /microminc/perl

# MNI data needs to be copied manually
RUN mkdir -vp /microminc/share \
&& cp -rv "$MNI_DATAPATH/surface-extraction" "/microminc/share"

FROM fnndsc/conda:python3.11.2
COPY --from=builder /microminc /opt/microminc
ENV PATH=/opt/microminc/bin:$PATH \
LD_LIBRARY_PATH=/opt/microminc/lib:$LD_LIBRARY_PATH \
MINC_FORCE_V2=1 MINC_COMPRESS=4 VOLUME_CACHE_THRESHOLD=-1 \
MNI_DATAPATH=/opt/microminc/share \
PERL5LIB=/opt/microminc/perl
5 changes: 5 additions & 0 deletions base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Uses [microminc](https://github.com/FNNDSC/microminc)
to create a minimized base image for `pl-fetal-surface-extract`,
which copies the necessary minc-tool binaries to a multi-arch conda image.

This image is built and pushed manually.
6 changes: 6 additions & 0 deletions base/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash -ex

exec docker buildx build --push \
--platform linux/amd64,linux/arm64,linux/ppc64le \
--build-arg http_proxy=$http_proxy \
-t docker.io/fnndsc/pl-fetal-surface-extract:base-1 .
4 changes: 2 additions & 2 deletions extract_cp/extract_surface.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ def __pick_side(mask: Path, side: SideStr) -> Optional[Side]:
return Side.RIGHT
if side == 'auto':
path = str(mask).lower()
if 'left' in path:
if 'left' in path or mask.name.startswith('lh.'):
return Side.LEFT
if 'right' in path:
if 'right' in path or mask.name.startswith('rh.'):
return Side.RIGHT
raise ValueError(f'Substring "left" nor "right" found in: {path}')
if side == 'none':
Expand Down

0 comments on commit 00cc0a4

Please sign in to comment.