diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b04600a --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +sandbox diff --git a/Dockerfile b/Dockerfile index d6f112a..370cc9d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,19 +12,17 @@ COPY manifest.json ${FLYWHEEL}/manifest.json ENTRYPOINT ["/flywheel/v0/fw_heudiconv_run.py"] # Copy over python scripts that generate the BIDS hierarchy -RUN apt-get -y update -RUN apt-get install -y zip curl nodejs -RUN curl -L https://www.npmjs.com/install.sh | sh +RUN apt-get -y update && apt-get install -y curl +RUN curl -sL https://deb.nodesource.com/setup_10.x | bash +RUN apt-get -y update && apt-get install -y zip nodejs RUN npm install -g bids-validator -RUN pip install --no-cache heudiconv flywheel-sdk pandas fw-heudiconv +RUN pip install --no-cache heudiconv nipype flywheel-sdk pandas + COPY . /src + RUN cd /src \ && pip install . \ - && pip install --no-cache --no-deps heudiconv \ - && pip install --no-cache flywheel-sdk \ - && pip install --no-cache nipype \ - && rm -rf /src \ - && apt-get install -y --no-install-recommends zip + && rm -rf /src COPY fw_heudiconv_run.py /flywheel/v0/fw_heudiconv_run.py RUN chmod +x ${FLYWHEEL}/* diff --git a/fw_heudiconv/cli/meta.py b/fw_heudiconv/cli/meta.py index 9359a69..e705692 100644 --- a/fw_heudiconv/cli/meta.py +++ b/fw_heudiconv/cli/meta.py @@ -62,7 +62,7 @@ def initialise_dataset(client, project_label, subject_labels=None, session_label def attach_to_object(object, file, dry_run): if dry_run: - logger.info("{}\t-->\t{}".format(file.ljust(20), )) + logger.info("{}\t-->\t{}".format(file.ljust(20), object.label)) return 0 my_file = Path(file) if my_file.is_file(): diff --git a/fw_heudiconv/cli/tabulate.py b/fw_heudiconv/cli/tabulate.py index 9745f9d..c835957 100644 --- a/fw_heudiconv/cli/tabulate.py +++ b/fw_heudiconv/cli/tabulate.py @@ -88,7 +88,7 @@ def get_parser(): default=False ) parser.add_argument( - "--dry_run", + "--dry-run", help="Don't apply changes", action='store_true', default=False diff --git a/fw_heudiconv_run.py b/fw_heudiconv_run.py index f4a0928..adde4ce 100755 --- a/fw_heudiconv_run.py +++ b/fw_heudiconv_run.py @@ -10,7 +10,7 @@ # logging stuff logging.basicConfig(level=logging.INFO) logger = logging.getLogger('fw-heudiconv-gear') -logger.info("=======: fw-heudiconv gear manager starting up :=======\n".center(70)) +logger.info("{:=^70}\n".format(": fw-heudiconv gear manager starting up :")) # start up inputs invocation = json.loads(open('config.json').read()) @@ -63,7 +63,10 @@ logger.info("Dry run: {}".format(dry_run)) # action -call = "fw-heudiconv-{} --dry-run --verbose --api-key {} --project {}".format(action.lower(), key, project_label, heuristic) +call = "fw-heudiconv-{} --verbose --api-key {} --project {}".format(action.lower(), key, project_label, heuristic) + +if dry_run: + call = call + " --dry-run" if heuristic and action.lower() == "curate": call = call + " --heuristic {}".format(heuristic) @@ -81,6 +84,9 @@ if action.lower() == "validate": call = call + " --flywheel --directory {}".format("/flywheel/v0/output") +if action.lower() == "tabulate": + call = call + " --path {}".format("/flywheel/v0/output") + os.system(call) if action.lower() in ["export", "tabulate"]: @@ -98,4 +104,4 @@ shutil.rmtree(x) logger.info("Done!") -logger.info("=======: Exiting fw-heudiconv gear manager :=======\n".center(70)) +logger.info("{:=^70}\n".format(": Exiting fw-heudiconv gear manager :")) diff --git a/manifest.json b/manifest.json index 65d1522..9de91c7 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name": "fw-heudiconv", "label": "Flywheel HeuDiConv", "description": "HeuDiConv-style BIDS curation on Flywheel. Flywheel HeuDiConv (or fw-heudiconv, pronounced /fwuː di kɑː n(v)/) is a Python-based toolkit that leverages the flexibility and comprehensiveness of HeuDiConv to curate neuroimaging data on Flywheel into a BIDS-valid format.", - "version": "0.1.0_0.1.0", + "version": "0.2.3_0.1.0", "inputs": { "api-key": { "base": "api-key" @@ -16,7 +16,7 @@ "config": { "action": { "default": "Curate", - "description": "Curate: Apply heuristic to project. Export: Create zip of BIDS tree. Tabulate: Create a table of sequence information in a project.", + "description": "Curate: Apply heuristic to project. Export: Create zip of BIDS tree. Tabulate: Create a table of sequence information in a project. Clear: Clear BIDS data from project. Meta: Autogenerate BIDS metadata for project.", "type": "string", "enum": ["Curate", "Export", "Tabulate", "Clear", "Meta"] }, @@ -51,7 +51,7 @@ "custom": { "gear-builder": { "category": "analysis", - "image": "pennbbl/fw-heudiconv:latest" + "image": "pennbbl/fw-heudiconv:0.2.0_0.1.0" }, "flywheel":{"suite": "PennBBL"} }