Skip to content

Commit

Permalink
bugfixes and docker ignore added
Browse files Browse the repository at this point in the history
  • Loading branch information
TinasheMTapera committed Oct 9, 2019
1 parent f6601b8 commit 6594812
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 17 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sandbox
16 changes: 7 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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}/*
Expand Down
2 changes: 1 addition & 1 deletion fw_heudiconv/cli/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion fw_heudiconv/cli/tabulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions fw_heudiconv_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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)
Expand All @@ -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"]:
Expand All @@ -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 :"))
6 changes: 3 additions & 3 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"]
},
Expand Down Expand Up @@ -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"}
}
Expand Down

0 comments on commit 6594812

Please sign in to comment.