Conversation

satra

this is to improve usage of s3 data grabber.
several examples here: https://.com/kellyhennigan/cueexp_scripts/blob/25372d4f221762af6d79d1af67a8570f2c546b20/svmrfe/venv/lib64/python2.7/site-packages/nipype/interfaces/tests/test_io.py

Acknowledgment

  • (Mandatory) I acknowledge that this contribution will be available under the Apache 2 license.

@codecov-io

Codecov Report

Merging #2849 into master will decrease coverage by 4.58%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2849      +/-   ##
==========================================
- Coverage   67.47%   62.88%   -4.59%     
==========================================
  Files         341      339       -2     
  Lines       43362    43311      -51     
  Branches     5379     5095     -284     
==========================================
- Hits        29257    27236    -2021     
- Misses      13409    15039    +1630     
- Partials      696     1036     +340
FlagCoverage Δ
#smoketests?
#unittests62.88% <ø> (-2.01%)⬇️
Impacted FilesCoverage Δ
nipype/interfaces/io.py47.26% <ø> (-6.73%)⬇️
nipype/interfaces/nilearn.py40% <0%> (-56.67%)⬇️
nipype/utils/spm_docs.py25.92% <0%> (-44.45%)⬇️
nipype/testing/fixtures.py56% <0%> (-42.67%)⬇️
nipype/interfaces/nitime/analysis.py43.15% <0%> (-36.85%)⬇️
nipype/interfaces/fsl/model.py49.11% <0%> (-31.51%)⬇️
nipype/interfaces/freesurfer/base.py50% <0%> (-30.51%)⬇️
nipype/utils/logger.py59.7% <0%> (-29.86%)⬇️
nipype/algorithms/rapidart.py35% <0%> (-29.42%)⬇️
nipype/interfaces/spm/base.py58.08% <0%> (-29.05%)⬇️
... and 54 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update add9bd7...ea4fb4b. Read the comment docs.

@satra

@TimVanMourik ( here is an example of s3 datagrabber )

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP8 issues identified by Codacy.

@effigieseffigies added this to the 1.1.8 milestone Jan 13, 2019
@wtriplett

Thanks for this example. The s3grab.inputs.template = '*' suggests a glob style wildcard, while the docstring claims (correctly) that for the S3DataGrabber a regex is used. So while this example works, maybe a more regex-looking template spec would highlight that difference from DataGrabber to the reader.

@effigieseffigies changed the title enh: add s3 datagrabber example DOC: Add S3DataGrabber example Jan 23, 2019
@effigies

Going to go ahead and merge this. @wtriplett Feel free to open a pull request with an improved (or, better, another) example.

@effigieseffigies merged commit b0ce2e1 into master Jan 23, 2019
@effigieseffigies deleted the satra-doc-s3grab branch January 23, 2019 00:09
@satra

@TimVanMourik were you able to use this to create an s3datagrabber example? i'm not completely sure how i would initialize the s3datagrabber appropriately with giraffe.

@wtriplett - it would be nice to add a regex example. i just wanted to get an example in, since there were none :)

yarikoptic added a commit to yarikoptic/nipype that referenced this pull request Feb 4, 2019
1.1.8 (January 28, 2019)

  * FIX: ANTS LaplacianThickness cmdline opts fixed up (nipy#2846)
  * FIX: Resolve LinAlgError during SVD (nipy#2838)
  * ENH: Add interfaces wrapping DIPY worflows (nipy#2830)
  * ENH: Update BIDSDataGrabber for pybids 0.7 (nipy#2737)
  * ENH: Add FSL `eddy_quad` interface (nipy#2825)
  * ENH: Support tckgen -select in MRtrix3 v3+ (nipy#2823)
  * ENH: Support for BIDS event files (nipy#2845)
  * ENH: CompositeTransformUtil, new ANTs interface (nipy#2785)
  * RF: Move pytest and pytest-xdist from general requirement into tests_required (nipy#2850)
  * DOC: Add S3DataGrabber example (nipy#2849)
  * DOC: Skip conftest module in API generation (nipy#2852)
  * DOC: Hyperlink DOIs to preferred resolver (nipy#2833)
  * MAINT: Install numpy!=1.16.0 from conda in Docker (nipy#2862)
  * MAINT: Drop pytest-xdist requirement, minimum pytest version  (nipy#2856)
  * MAINT: Disable numpy 1.16.0 for Py2.7 (nipy#2855)

* tag '1.1.8': (79 commits)
  MNT: Add @feilong to .zenodo, update ordering
  MNT: Update .mailmap
  MNT: Update .zenodo ordering
  Accept invitation as Zenodo release co-author (see nipy#2864)
  MAINT: Update .mailmap
  BF: allowing bids_event_file as alternate input
  MNT: Update .zenodo ordering
  MNT: Version 1.1.8
  DOC: 1.1.8 changelog
  Update nipype/interfaces/dipy/tracks.py
  Update nipype/interfaces/dipy/reconstruction.py
  MNT: Install numpy!=1.16.0 from conda in Docker
  Add FSL auto test
  remake specs
  Update nipype/interfaces/io.py
  Remove return type named tuple
  Update nipype/info.py
  STY: Whitespace, line length
  Remove out_ prefix from EddyQuad outputs
  Apply minor edits from code review
  ...
@TimVanMourik

Sorry for the delay. Yes, made an example:
https://giraffe.tools/porcupine/TimVanMourik/SomeGiraffeExample/s3 or a permanent link to current status, in case the branch gets updated.

This example:

  • It implements the file handling by:
    • mapping the input subj_id and run_num ...
    • ...via the field_template and template_args...
    • ...to output func and struct.
    • It's far from intuitive but it's the way the S3DataGrabber works so there's not much I can do about it from my side.
  • Grabs data from the example file you mentioned
    • Iterates over subjects in the first node, but not over runs: the structural pipeline needs to be performed only for each subject. The functional pipeline is later also iterated over runs.
  • Further implements a basic pipeline and stores the data at the end.

All Nipype modules that requires dynamic inputs/outputs are a bit cumbersome in GiraffeTools, but can be dealt with by adding ports manually. It is a bit contrary to the philosophy though, as I like to think of functions as static.

Sign up for free to join this conversation on . Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.