SGE Workflow Plugin

27 views
Skip to first unread message

Arman Eshaghi

unread,
Jun 11, 2013, 7:41:52 AM6/11/13
to nipy...@googlegroups.com
Dear all,

I can't run SGE plugin from any python code, but it seems that my SGE is working fine outside python and nipype. For example I get the following error on ExtractROI:

TraitError: Cannot set the undefined 'plugin' attribute of a 'ExtractROIInputSpec' object.

Here is my code:

 1 import nipype$                                                                                                                                                                                                                            
 2 from nipype.interfaces import fsl$                                             
 3 for i in range(0,90):$                                                         
 4     if i>=0 and i<35:$                                                         
 5         group = 'Controls'$                                                    
 6     elif i>=35 and i<60:$                                                      
 7         group = 'MS'$                                                          
 8     else:$                                                                     
 9         group ='NMO'$                                                          
10     fslroi = nipype.interfaces.fsl.utils.ExtractROI(in_file='all_FA_skeletonised.nii.gz', roi_file='%s_%d_FA_skletonized.nii.gz' %(group, i), t_min=i, t_size=1)$
11     fslroi.run(plugin='SGE')$                                                 
12     print 'subject %d in group %s extracted' %(i, group)$  

Do I have to import a specific library in advance? On nipype documentation it seems that the code should run seamlessly without importing any extras (other than nipype itself)? 

Thanks in advance for your response.

All the best,
-Arma

Chris Filo Gorgolewski

unread,
Jun 11, 2013, 8:01:33 AM6/11/13
to nipy...@googlegroups.com
Execution plugins are supported for Workflows only at the moment (actually using them fro interfaces did not cross my mind before). The easiest way to fix your code is to:

- add "nodes = []"  before the for loop
- wrap the fslroi in Node object in line 10, remember to give each node a unique name (using "i" would be easiest)
- replace line 11 with "nodes.append(fslroi)"
- after the for loop add three lines:
wf = Workflow("my_workflow")
wf.add_nodes(nodes)
wf.run(plugin='SGE')

Best,
Chris


--
 
---
You received this message because you are subscribed to the Google Groups "NiPy Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nipy-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages