Giter Club home page Giter Club logo

pyslicetime's Introduction

pyslicetime

Slice-time interpolation for fMRI data.

cubic interpolation used to resample each voxel’s time-series data to a new rate such that the same time points are obtained for all voxels. This can be useful if the trial duration is not evenly divisible by the TR, which then handles any jitter between trial onsets and slice acquisition times.

The motivation for upsampling is to exploit the intrinsic jitter between the data acquisition and the experimental paradigm.

matlab version:

An equivalent functionality exists in matlab, see: https://github.com/kendrickkay/knkutils/blob/master/timeseries/tseriesinterp.m

reference:

The logic of this procedure was introduced in the following pre-print: https://www.biorxiv.org/content/10.1101/868455v1.full.pdf

pyslicetime's People

Contributors

iancharest avatar jaspervandenbosch avatar thatch avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pyslicetime's Issues

Missing files in sdist

It appears that the manifest is missing at least one file necessary to build
from the sdist for version 0.2. You're in good company, about 5% of other
projects updated in the last year are also missing files.

+ /tmp/venv/bin/pip3 wheel --no-binary pyslicetime -w /tmp/ext pyslicetime==0.2
Looking in indexes: http://10.10.0.139:9191/root/pypi/+simple/
Collecting pyslicetime==0.2
  Downloading http://10.10.0.139:9191/root/pypi/%2Bf/a60/ebea2a7f1052b/pyslicetime-0.2.tar.gz (6.2 kB)
    ERROR: Command errored out with exit status 1:
     command: /tmp/venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-jtca8_3x/pyslicetime/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-jtca8_3x/pyslicetime/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-wheel-jtca8_3x/pyslicetime/pip-egg-info
         cwd: /tmp/pip-wheel-jtca8_3x/pyslicetime/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-wheel-jtca8_3x/pyslicetime/setup.py", line 4, in <module>
        with open('requirements.txt') as reqfile:
    FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

missing file

         [Node] Finished "fmriprep_wf.single_subject_1_wf.func_preproc_ses_2_task_fmriwmrsa_run_02_wf.bold_stc_wf.slice_timing_correction".
190719-16:53:54,529 nipype.workflow INFO:
         [Node] Finished "fmriprep_wf.single_subject_1_wf.func_preproc_ses_2_task_fmriwmrsa_run_04_wf.bold_stc_wf.slice_timing_correction".
190719-16:53:55,382 nipype.workflow WARNING:
         Error while checking node hash, forcing re-run. Although this error may not prevent the workflow from running, it could indicate a major problem. Please report a new issue at https://github.com/nipy/nipype/issues adding the following information:

        Node: fmriprep_wf.single_subject_1_wf.func_preproc_ses_2_task_fmriwmrsa_run_02_wf.bold_split
        Interface: nipype.interfaces.fsl.utils.Split
        Traceback:
Traceback (most recent call last):

  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/base.py", line 338, in _local_hash_check
    cached, updated = self.procs[jobid].is_cached()

  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 296, in is_cached
    hashed_inputs, hashvalue = self._get_hashval()

  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 493, in _get_hashval
    self._get_inputs()

  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 540, in _get_inputs
    self.set_input(key, deepcopy(output_value))

  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 278, in set_input
    setattr(self.inputs, parameter, deepcopy(val))

  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/traits_extension.py", line 112, in validate
    self.info_text, value))

traits.trait_errors.TraitError: The trait 'in_file' of a SplitInputSpec instance is an existing file name, but the path  'slicetime.nii.gz' does not exist.

Error setting node input:
Node: bold_split
input: in_file
results_file: /work/fmriprep_wf/single_subject_1_wf/func_preproc_ses_2_task_fmriwmrsa_run_02_wf/bold_stc_wf/slice_timing_correction/result_slice_timing_correction.pklz
value: slicetime.nii.gz

nibabel saving problem

Node: fmriprep_wf.single_subject_1_wf.func_preproc_ses_1_task_fmriwmrsa_run_02_wf.bold_stc_wf.slice_timing_correction
Working directory: /work/fmriprep_wf/single_subject_1_wf/func_preproc_ses_1_task_fmriwmrsa_run_02_wf/bold_stc_wf/slice_timing_correction

Node inputs:

in_file = /work/fmriprep_wf/single_subject_1_wf/func_preproc_ses_1_task_fmriwmrsa_run_02_wf/bold_reference_wf/validate/sub-1_ses-1_task-fmriwmrsa_run-02_bold_valid.nii.gz
out_file =
slicetimes = [0.66, 0.0, 0.44, 0.075, 0.515, 0.1475, 0.5875, 0.295, 0.735, 0.3675, 0.8075, 0.22, 0.66, 0.0, 0.44, 0.075, 0.515, 0.1475, 0.5875, 0.295, 0.735, 0.3675, 0.8075, 0.22, 0.66, 0.0, 0.44, 0.075, 0.515, 0.1475, 0.5875, 0.295, 0.735, 0.3675, 0.8075, 0.22, 0.66, 0.0, 0.44, 0.075, 0.515, 0.1475, 0.5875, 0.295, 0.735, 0.3675, 0.8075, 0.22]
tr_new = 0.5
tr_old = 0.9

Traceback (most recent call last):
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 69, in run_node
result['result'] = node.run(updatehash=updatehash)
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 472, in run
result = self._run_interface(execute=True)
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 563, in _run_interface
return self._run_command(execute)
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 643, in _run_command
result = self._interface.run(cwd=outdir)
File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 375, in run
runtime = self._run_interface(runtime)
File "/usr/local/miniconda/lib/python3.7/site-packages/slicetime/nipype_interface.py", line 44, in _run_interface
tr_new=self.inputs.tr_new,
File "/usr/local/miniconda/lib/python3.7/site-packages/slicetime/main.py", line 71, in run_slicetime
nib.save(corr_img, outpath)
File "/usr/local/miniconda/lib/python3.7/site-packages/nibabel/loadsave.py", line 106, in save
froot, ext, trailing = splitext_addext(filename, ('.gz', '.bz2'))
File "/usr/local/miniconda/lib/python3.7/site-packages/nibabel/filename_parser.py", line 265, in splitext_addext
if endswith(filename, ext):
File "/usr/local/miniconda/lib/python3.7/site-packages/nibabel/filename_parser.py", line 223, in _iendswith
return whole.lower().endswith(end.lower())
AttributeError: '_Undefined' object has no attribute 'lower'

Module slice_timing_correction has no output called out_file

    upsample_tr=upsample_tr
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/bold/stc.py", line 65, in init_bold_stc_wf
    return init_bold_stc_pyslt_wf(metadata, name, upsample_tr)
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/bold/stc.py", line 156, in init_bold_stc_pyslt_wf
    (slice_timing_correction, outputnode, [('out_file', 'stc_file')]),
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/workflows.py", line 214, in connect
    '\n'.join(['Some connections were not found'] + infostr))
Exception: Some connections were not found
Module slice_timing_correction has no output called out_file

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.