Coder Social home page Coder Social logo

brainhack-ch / superres-mri Goto Github PK

View Code? Open in Web Editor NEW
5.0 7.0 1.0 13.31 MB

Portable, modular, reusable, and reproducible processing pipeline software for fetal brain MRI super-resolution

License: Other

Jupyter Notebook 82.72% Python 15.60% Dockerfile 1.17% Shell 0.51%
nipype bids-format bidsapp neuroimaging super-resolution slice-to-volume mri fetal opengeneva2019 brainhack-global

superres-mri's Issues

Silent failure of nipype with Docker

When running a SINAPPS using Docker, the script reports no error but fails to run the executable inside docker if:

  • docker engine is not running
  • the relevant Docker image is not present

This should be detected as an error.

Implementation of SINAPPS

List of SINAPPS to be implemented:

  • NLMdenoising
  • CorrectSliceIntensity
  • SliceBySliceN4BiasFieldCorrection
  • SliceBySliceCorrectBiasField
  • CorrectSliceIntensity
  • IntensityStandardization
  • HistogramNormalization
  • ImageReconstruction
  • TVSuperResolution

Tasks involved for each SINAPP:

  • Check if interfaces already implemented by Priscille and Hamza
  • Adapt to sinapp framework or implement interface for each program of the Containerized MIALSRTK library listed above.
  • Creation of each sinapp underlies the creation of the following files stored under sinapps/<sinapp-name>/ (see sinapps/nlmdenoise/ for an example):
    • The implementation of the run.py script which provides a BIDS app argument parser, the creation of the workflow and the execution of the sinapp.
    • The implementation of the Dockerfile for containerization that describes the computing environment used to execute the workflow based on an Ubuntu 16.04 LTS system. A conda environment.yml is used to facilitate the installation of the python environment.

Error: BIDSDataGrabber with pybids >= 0.9

BIDS data grabber does not work with pybids >= 0.9:

Jupyter Notebook error:

191108-16:17:18,426 nipype.workflow INFO:
	 Workflow bids_demo settings: ['check', 'execution', 'logging', 'monitoring']
191108-16:17:18,441 nipype.workflow INFO:
	 Running serially.
191108-16:17:18,446 nipype.workflow INFO:
	 [Node] Setting-up "bids_demo.bids_grabber" in "/home/brainhacker/data/derivatives/mialsrtk/bids_demo/bids_grabber".
191108-16:17:18,450 nipype.workflow INFO:
	 [Node] Running "bids_grabber" ("nipype.interfaces.io.BIDSDataGrabber")
191108-16:17:18,899 nipype.workflow WARNING:
	 Storing result file without outputs
191108-16:17:18,901 nipype.workflow WARNING:
	 [Node] Error on "bids_demo.bids_grabber" (/home/brainhacker/data/derivatives/mialsrtk/bids_demo/bids_grabber)
191108-16:17:18,903 nipype.workflow ERROR:
	 Node bids_grabber failed to run on host bh-p05-03.
191108-16:17:18,903 nipype.workflow ERROR:
	 Saving crash info to /home/brainhacker/superres-mri/notebooks/crash-20191108-161718-brainhacker-bids_grabber-2e444a58-15b6-4bc4-b0c8-a98a3b1476bb.pklz
Traceback (most recent call last):
  File "/home/brainhacker/miniconda3/envs/supermri-env/lib/python3.7/site-packages/nipype/pipeline/plugins/linear.py", line 48, in run
    node.run(updatehash=updatehash)
  File "/home/brainhacker/miniconda3/envs/supermri-env/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 479, in run
    result = self._run_interface(execute=True)
  File "/home/brainhacker/miniconda3/envs/supermri-env/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 569, in _run_interface
    return self._run_command(execute)
  File "/home/brainhacker/miniconda3/envs/supermri-env/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 662, in _run_command
    result = self._interface.run(cwd=outdir)
  File "/home/brainhacker/miniconda3/envs/supermri-env/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 384, in run
    outputs = self.aggregate_outputs(runtime)
  File "/home/brainhacker/miniconda3/envs/supermri-env/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 461, in aggregate_outputs
    predicted_outputs = self._list_outputs()  # Predictions from _list_outputs
  File "/home/brainhacker/miniconda3/envs/supermri-env/lib/python3.7/site-packages/nipype/interfaces/io.py", line 2836, in _list_outputs
    derivatives=self.inputs.index_derivatives)
  File "/home/brainhacker/miniconda3/envs/supermri-env/lib/python3.7/site-packages/bids/layout/layout.py", line 226, in __init__
    index_metadata=index_metadata)
  File "/home/brainhacker/miniconda3/envs/supermri-env/lib/python3.7/site-packages/bids/layout/layout.py", line 556, in add_derivatives
    self.derivatives[pipeline_name] = BIDSLayout(deriv, **kwargs)
  File "/home/brainhacker/miniconda3/envs/supermri-env/lib/python3.7/site-packages/bids/layout/layout.py", line 211, in __init__
    indexer.index_metadata()
  File "/home/brainhacker/miniconda3/envs/supermri-env/lib/python3.7/site-packages/bids/layout/index.py", line 284, in index_metadata
    file_md.update(pl)
ValueError: dictionary update sequence element #0 has length 4; 2 is required

191108-16:17:18,905 nipype.workflow INFO:
	 ***********************************
191108-16:17:18,905 nipype.workflow ERROR:
	 could not run node: bids_demo.bids_grabber
191108-16:17:18,906 nipype.workflow INFO:
	 crashfile: /home/brainhacker/superres-mri/notebooks/crash-20191108-161718-brainhacker-bids_grabber-2e444a58-15b6-4bc4-b0c8-a98a3b1476bb.pklz
191108-16:17:18,907 nipype.workflow INFO:
	 ***********************************
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-6-288982abd1f9> in <module>
     68 
     69 wf.connect(preparePaths, "docker_T2ws_paths", nlmDenoise, "input_images")
---> 70 res = wf.run()

~/miniconda3/envs/supermri-env/lib/python3.7/site-packages/nipype/pipeline/engine/workflows.py in run(self, plugin, plugin_args, updatehash)
    597         if str2bool(self.config['execution']['create_report']):
    598             self._write_report_info(self.base_dir, self.name, execgraph)
--> 599         runner.run(execgraph, updatehash=updatehash, config=self.config)
    600         datestr = datetime.utcnow().strftime('%Y%m%dT%H%M%S')
    601         if str2bool(self.config['execution']['write_provenance']):

~/miniconda3/envs/supermri-env/lib/python3.7/site-packages/nipype/pipeline/plugins/linear.py in run(self, graph, config, updatehash)
     69 
     70         os.chdir(old_wd)  # Return wherever we were before
---> 71         report_nodes_not_run(notrun)

~/miniconda3/envs/supermri-env/lib/python3.7/site-packages/nipype/pipeline/plugins/tools.py in report_nodes_not_run(notrun)
     93                 logger.debug(subnode._id)
     94         logger.info("***********************************")
---> 95         raise RuntimeError(('Workflow did not execute cleanly. '
     96                             'Check log for details'))
     97 

RuntimeError: Workflow did not execute cleanly. Check log for details

Docker-out-of-Docker (DooD) Solution

Brainhack Global Geneva 2019 Challenge

Build and run a Docker image executes a nipype workflow that should run an other Docker image that contains the C++ NLMdenoising program of the MIALSRTK library.

Road Map:

  • Creation of first sinapp workflow with BIDS App parser (python / not containerized yet)
  • Creation of Dockerfile
  • Build, test, and make it work

Update README

  • Running the python notebook does not work
  • Add instructions for docker container (mial-srtk)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.