FCP-INDI / C-PAC

Configurable Pipeline for the Analysis of Connectomes
https://fcp-indi.github.io/
GNU Lesser General Public License v3.0
62 stars 40 forks source link

Where are placed the time series? #445

Closed Angel-Fernandez closed 9 years ago

Angel-Fernandez commented 9 years ago

Hi again @jpellman ,

I'm trying to do a SCA Analysis We have problems with the Time Series outputs related with ROI. I don't know in which folder is stored the time series (csv and numpy). Can you help me please?

Thanks and best

jpellman commented 9 years ago

Hi Angel,

The ROI time series should be in a directory modelled after the following:

[output directory]/[pipeline directory]/[session]/roi_timeseries_for_SCA/[scan]/_csfthreshold[threshold]/_gmthreshold[threshold]/_wmthreshold[threshold]/_compcorncomponents[component count]_selector_pc[number].linear[0/1].wm[0/1].global[0/1].motion[0/1].quadratic[0/1].gm[0/1].compcor[0/1].csf[0/1]/_bandpassfreqs[frequency range]/[mask name]

With the thresholds and experiment specific directories substituted accordingly.

Angel-Fernandez commented 9 years ago

This folder don't exists. I'm getting the next error for every subject:

Error name: cpac_pipeline_0036

This is a pipeline creation error - the workflows have not started yet.

Process Process-238: Traceback (most recent call last): File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run self._target(_self._args, *_self._kwargs) File "/usr/local/lib/python2.7/dist-packages/CPAC/pipeline/cpac_pipeline.py", line 2485, in prep_workflow node, out_file = strat.get_node_from_resource_pool('voxel_timeseries_for_SCA') TypeError: 'NoneType' object is not iterable

The pipeline continues normally when occurs some errors but finally stops with one subject with the same error.

Thanks

jpellman commented 9 years ago

Hi Angel,

What is "maskSpecificationFileForSCA" set to in your pipeline configuration YAML? If it is set to 'None', then the pipeline might not be able to run correctly. Let me know if that helps. At any rate, you should not be receiving a TypeError for 'NoneType" objects, which means we need to fix part of the code. If you are still experiencing difficulty, I can send you any patches we develop to see if that fixes the issue.

Angel-Fernandez commented 9 years ago

Hi John,

Are you refering to the ROI Specification file for SCA? This file must be a text file with a list of paths for each ROI nifti file or can be directly a unique nifti file with all the ROIs?

jpellman commented 9 years ago

Hi Angel,

I'm referring to the .yml file generated by C-PAC that specifies how the pipeline should be configured. This should look similar to this file and you can open it in any standard text editor. There should be some lines similar to the following:

Full path to a text file containing a list ROI files.

Each line in this file should be the path to a NIfTI file containing a single ROI.

If you only wish to extract time series for newly defined spherical seed ROIs, set this field to None.

maskSpecificationFileForSCA : /path/to/mask/specs

If the final line looks like this-

maskSpecificationFileForSCA : None

- then C-PAC may not be able to construct a working pipeline.

Angel-Fernandez commented 9 years ago

Yes, the maskSpecidicationForSCA is set to None.

jpellman commented 9 years ago

Hi Angel,

In order for SCA to work, you must first specify at least one region-of-interest mask containing the voxels you would like to correlate the seed voxel with. You can do this by following these steps:

  1. Create a text file named 'mask_specs.txt' (or any other reasonable name of your choosing).
  2. For each line in 'mask_specs.txt', type in a full path to a binary-valued NifTI file that represents your ROI.
  3. Within your pipeline configuration .yml file, set maskSpecificationFileForSCA to the full path to 'mask_specs.txt'.

Once you've done this, SCA should run.

Angel-Fernandez commented 9 years ago

Ok thanks, this solved my error but now I have a new one.
This is my log:

File: crash-20150227-134415-cafetero-check_timeseries.a0.b0.a0.pklz Node: resting_preproc_00_EP_0016.temporal_regression_sca_0.check_timeseries.a0.b0.a0 Working directory: /home/cafetero/datos/rdoEscoliosis/rdoEP/workingDirectory/resting_preproc_00_EP_0016/temporal_regression_sca_0/_scan_func_00_EP_0016_fMRI/_bandpass_freqs_0.01.0.1/_mask_rois_2mm_3/check_timeseries

Node inputs:

function_str = S"def check_ts(in_file):\n import numpy as np\n timepoints, rois = np.loadtxt(in_file).shape\n if rois > timepoints:\n message = ('\n\n\n_The number of timepoints (' + str(timepoints)\n + ') is smaller than the number of ROIs to run ('\n + str(rois) + ') - therefore the GLM is'\n + ' underspecified and can\'t run._\n\n\n')\n print(message)\n raise Exception(message)\n else:\n return in_file\n" . ignore_exception = False in_file = /media/datos/rdoEscoliosis/rdoEP/workingDirectory/resting_preproc_00_EP_0016/roi_timeseries_for_sca_0/_scan_func_00_EP_0016_fMRI/_bandpass_freqs_0.01.0.1/_mask_rois_2mm_3/timeseries_roi/roi_rois_2mm_3.txt

Traceback: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/nipype/pipeline/plugins/multiproc.py", line 18, in run_node result['result'] = node.run(updatehash=updatehash) File "/usr/lib/python2.7/dist-packages/nipype/pipeline/engine.py", line 1424, in run self._run_interface() File "/usr/lib/python2.7/dist-packages/nipype/pipeline/engine.py", line 1534, in _run_interface self._result = self._run_command(execute) File "/usr/lib/python2.7/dist-packages/nipype/pipeline/engine.py", line 1660, in _run_command result = self._interface.run() File "/usr/lib/python2.7/dist-packages/nipype/interfaces/base.py", line 998, in run runtime = self._run_interface(runtime) File "/usr/lib/python2.7/dist-packages/nipype/interfaces/utility.py", line 436, in _run_interface out = function_handle(**args) File "", line 3, in check_ts ValueError: need more than 1 value to unpack Interface Function failed to run.

I've put in the .txt four absolute paths each one for a nii.gz with one roi per file. The log says that the number of timepoints is smaller than the number of ROIs but i think that it can't be possible. May be the ROIS are not well located?

Thanks again

Angel-Fernandez commented 9 years ago

I've 160 volumes and 4 rois. This is a .csv roi (number four) timeseries example.

screenhunter_176 mar 02 08 24

Also I have another question, If I put all the rois together in a single file, I'll obtain the results for each ROI separatedly?

jpellman commented 9 years ago

Hi Angel,

This is a recognized bug with how C-PAC parses ROIs. For this functionality to work right now, you need to make sure that all ROIs are within the same NifTI file.

The following discussion is related and might give you a better idea of what this error signifies:

https://github.com/FCP-INDI/C-PAC/issues/417

Best, John Pellman

Angel-Fernandez commented 9 years ago

Ok Thanks John