Hi Ben, All,<br><br>I was thinking of something which Is along the lines of the solution you mention:<br><br>I.e., I will have the files I need in a directory, and attempt to map via regexp<br>E.g., if the directory contains <br>
<br>file1.Head file1.BRIK, file2.Head file2.BRIK<br><br>The mapper will map files to my complex type:<br>mytype t;<br>t[0].head = file1.HEAD<br>t[0].brik = file1.BRIK<br>t[1].head = file2.BRIK<br>t[1].brik = file2.BRIK<br>
and I will be able to pass this to calls as MyCall(t[0])<br>[to the best of my understanding, I can achieve this now with csv mapper, but not via any other way unless I write a custom mapper, java?]<br><br>But this doesn't take care of the other use of types that I planned on, which is using them as a placeholder for results of calls.<br>
I,e., if a call generates a file4.HEAD and file4.BRIK file as output, it would be nice to have the ability to say<br>mytpe result = MyCall(myarray[0])<br>and then automotatically get 'result' populated<br>result.head == HEAD result of MyCall<br>
result.brik == BRIK result of MyCall<br><br>From the viewpoint of the workflow, what this will look like is that the functions took mytpe as input and gave mytype as output rather than specific filenames. <br>I'm new to the SWIFT so might be confusing design principles.<br>
<br>Best,<br>Uri<br><br><br><div class="gmail_quote">On Sun, May 4, 2008 at 5:05 PM, Ben Clifford <<a href="mailto:benc@hawaga.org.uk">benc@hawaga.org.uk</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
The v3 code probably has a very similar problem to that expressed in<br>
bug123, which I think is that mapper parameters don't interact in well<br>
with runtime constructed datasets.<br>
<br>
Perhaps this would be doable with a custom mapper that mapped an array inp<br>
declared as:<br>
<br>
type t { file head; file brik; }<br>
t inp[][];<br>
<br>
such that:<br>
<br>
inputs/Snnnn.runbyrun.reg_TS_run-.rrrrrr+orig.sssss<br>
<br>
is mapped to:<br>
<br>
inp[nnn][rrrr].sssss<br>
<br>
That is, rather than feeding list of nnn and rrr and then attempting to<br>
construct filenames, do it the other way round - use the presence of files<br>
in the input/ directory to cause a data structure to be constructed.<br>
<br>
That would be straightforward, I think, if you want to process all files<br>
that look like:<br>
<br>
inputs/S*.runbyrun.reg_TS_run-*+orig.*<br>
<br>
rather than some subset of those.<br>
<br>
So one question is: do you want to process all files that look like:<br>
inputs/S*.runbyrun.reg_TS_run-*+orig.*<br>
or do you want to process only a subset? And if so, what is the longer<br>
term goal for selecting the subset (you have "05" and 1 hard-coded at the<br>
moment, but I guess there's some intention to do otherwise eventually)<br>
<div><div></div><div class="Wj3C7c"><br>
On Sun, 4 May 2008, Mihael Hategan wrote:<br>
<br>
> Right. The problem here is that you can't reasonably "assign" file names<br>
> to data on the fly.<br>
><br>
> How do your files look like? In other words, what are your input files?<br>
> (I get the ones in the graph, but you mention an array, so I figured<br>
> there's more).<br>
><br>
> Mihael<br>
><br>
> On Sun, 2008-05-04 at 11:54 -0500, Uri Hasson wrote:<br>
> > Hi Mihael,<br>
> ><br>
> > I'm trying to write an MRAC and so am finalizing up some swift<br>
> > routines...<br>
> ><br>
> > One thing I can't seem to manage is to declare a complex type that<br>
> > will contain two types (both of which are files), assign data to that<br>
> > type, and then pass that type to a call. I think my problem is that I<br>
> > don't know how to setup an array of structures and assign it values<br>
> > that are file locations.<br>
> ><br>
> > If you have a sec, could you advise on this?<br>
> > For starters, a graph of my current, nonelegant workflow can be seen<br>
> > in<br>
> > /disks/gpfs/fmri/cnari/swift/projects/uhasson/AFNIflows/SNR/snrgraph1.png<br>
> ><br>
> > and the script that generates it is:<br>
> > /disks/gpfs/fmri/cnari/swift/projects/uhasson/AFNIflows/SNR/AFNIsnrV2.swift<br>
> ><br>
> > All the procedures I write are very simple: they take *.HEAD and<br>
> > *.BRIK file pairs as input (a pair defines a brain dataset), and<br>
> > output a *.HEAD and *.BRIK file as output.<br>
> ><br>
> > Now, Currently, I am stating each HEAD and BRIK file seperately as<br>
> > arguments, e.g., AFNI_mean (string baseName, file headFile, file<br>
> > brikFile ...)<br>
> ><br>
> > What I want to do is create a type like<br>
> > type AFNI_obj{<br>
> > file head;<br>
> > file brik;<br>
> > };<br>
> ><br>
> > assign the *.HEAD and *.BRIK file to that type and then pass that<br>
> > complex type like this: AFNI_mean (string baseName, AFNI_obj t, ...)<br>
> ><br>
> > I've tried doing this with Sarah, but we couldn't get it to work.<br>
> > If I do the csv mapper way, I can do it (AFNIsnrV4.swift in same dir)<br>
> > but if I try constructing the filenames on the fly within the script<br>
> > (feeble attempts in AFNIsnrV3.swift), it doesn't work.<br>
> ><br>
> > I think what I don't understand is how to manully set up an array of<br>
> > structures similarly to what the csv mapper does.<br>
> > If meeting in person is faster, would be very glad to meet.<br>
> ><br>
> > Any advice,<br>
> > Much appreciated.<br>
> ><br>
> > Uri<br>
> ><br>
><br>
</div></div>> _______________________________________________<br>
> Swift-devel mailing list<br>
> <a href="mailto:Swift-devel@ci.uchicago.edu">Swift-devel@ci.uchicago.edu</a><br>
> <a href="http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel" target="_blank">http://mail.ci.uchicago.edu/mailman/listinfo/swift-devel</a><br>
><br>
><br>
</blockquote></div><br>