Repository navigation
Fcma mvpa searchlight - #154
Conversation
…g them in via bcast_var
… in all MPI processes; write out results in nifti format
| the condition labels of the epochs | ||
| len(labels) labels equals the number of epochs | ||
| assuming the epochs of the same sid are adjacent, | ||
| and sid is the index of raw\_data |
There was a problem hiding this comment.
Could you please explain more the meaning of sid?
| mask: 3D array | ||
|
|
||
| epoch\_info: list of tuple (label, sid, start, end) | ||
| the condition labels of the epochs |
There was a problem hiding this comment.
Please format this text like a normal paragraph, with sentences. Of course, you can use a bulletted list too if you think it helps.
|
|
||
| processed\_data: 4D array in shape [brain 3D + epoch] | ||
| contains the averaged and normalized brain data epoch by epoch | ||
| it is generated in _\preprocess\_data method |
There was a problem hiding this comment.
You must not reference private APIs (_preprocess_data) in the documentation of public APIs (MVPAVoxelSelector).
| sl: Searchlight | ||
| the distributed Searchlight object | ||
|
|
||
| processed\_data: 4D array in shape [brain 3D + epoch] |
There was a problem hiding this comment.
If processed_data is not passed to __init__, it must not be documented as a parameter. How about listing it as as an attribute and adding naming it processed_data_, like in SRM?
https://github.com/IntelPNI/brainiak/blob/master/brainiak/funcalign/srm.py#L116
This would be in accordance with our coding standards:
http://scikit-learn.org/stable/developers/contributing.html#estimated-attributes
Same for labels.
On the other hand, the whole FCMA architecture does not fit our coding standards (data is passed at instantiation, instead of through fit), so maybe it is best to leave this code as it is for the moment and restructure all of FCMA later. Up to you. But note that the current list of parameters is confusing, because not all parameters listed are accepted by __init__.
There was a problem hiding this comment.
The parameter list here documents the properties of MVPAVoxelSelector instead of the input of __init__. The two voxel selector of FCMA is not about fitting, so I didn't follow the standard to only pass data through fit. I agree to keep the code structure as it is and leave the restructure discussion later. For now, let me modify the properties not passed through __init__ as var_.
| self.mask = mask.astype(np.bool) | ||
| self.epoch_info = epoch_info | ||
| self.num_folds = num_folds | ||
| self.sl = Searchlight(sl_rad=sl_rad, max_blk_edge=max_blk_edge) |
There was a problem hiding this comment.
Why not let the user created the searchlight? Then you would not need to accept (and document) all the searchlight parameters in your __init__?
| epoch\_info: list of tuple (label, sid, start, end) | ||
| the condition labels of the epochs | ||
| len(labels) labels equals the number of epochs | ||
| assuming the epochs of the same sid are adjacent |
There was a problem hiding this comment.
Please write sentences in the docstrings. They are hard to follow without capitalization and punctuation.
| logger.info( | ||
| 'epoch separation done, takes %.2f s' % | ||
| (time2 - time1) | ||
| ) |
There was a problem hiding this comment.
Isn't debug more appropriate for timing messages?
| example running command: | ||
| mpirun -np 2 python mvpa_voxel_selection.py /Users/yidawang/data/face_scene/raw nii.gz /Users/yidawang/data/face_scene/mask.nii.gz | ||
| data/fs_epoch_labels.npy 18 | ||
| """ |
There was a problem hiding this comment.
How about providing some sample data like in SRM?
https://github.com/IntelPNI/brainiak/blob/master/examples/funcalign/download-data.sh
If the files are small enough (a few kB), you can even add them to Git.
There was a problem hiding this comment.
Also, how about making a shell script with the command, like for HTFA?
https://github.com/IntelPNI/brainiak/blob/master/examples/factoranalysis/run_mpi_htfa.sh
* Improve formatting of error messages. * Catch errors that occur when looking up function name from function ID. * Push warning to user if worker spends to long waiting for proper import counter. * Fixes. * Add comment.
enable activity-based voxel selection in the FCMA pipeline