[Swift-devel] Re: arrays of structures and building them in SWIFT
Mihael Hategan
hategan at mcs.anl.gov
Sun May 4 16:30:47 CDT 2008
Right. The problem here is that you can't reasonably "assign" file names
to data on the fly.
How do your files look like? In other words, what are your input files?
(I get the ones in the graph, but you mention an array, so I figured
there's more).
Mihael
On Sun, 2008-05-04 at 11:54 -0500, Uri Hasson wrote:
> Hi Mihael,
>
> I'm trying to write an MRAC and so am finalizing up some swift
> routines...
>
> One thing I can't seem to manage is to declare a complex type that
> will contain two types (both of which are files), assign data to that
> type, and then pass that type to a call. I think my problem is that I
> don't know how to setup an array of structures and assign it values
> that are file locations.
>
> If you have a sec, could you advise on this?
> For starters, a graph of my current, nonelegant workflow can be seen
> in
> /disks/gpfs/fmri/cnari/swift/projects/uhasson/AFNIflows/SNR/snrgraph1.png
>
> and the script that generates it is:
> /disks/gpfs/fmri/cnari/swift/projects/uhasson/AFNIflows/SNR/AFNIsnrV2.swift
>
> All the procedures I write are very simple: they take *.HEAD and
> *.BRIK file pairs as input (a pair defines a brain dataset), and
> output a *.HEAD and *.BRIK file as output.
>
> Now, Currently, I am stating each HEAD and BRIK file seperately as
> arguments, e.g., AFNI_mean (string baseName, file headFile, file
> brikFile ...)
>
> What I want to do is create a type like
> type AFNI_obj{
> file head;
> file brik;
> };
>
> assign the *.HEAD and *.BRIK file to that type and then pass that
> complex type like this: AFNI_mean (string baseName, AFNI_obj t, ...)
>
> I've tried doing this with Sarah, but we couldn't get it to work.
> If I do the csv mapper way, I can do it (AFNIsnrV4.swift in same dir)
> but if I try constructing the filenames on the fly within the script
> (feeble attempts in AFNIsnrV3.swift), it doesn't work.
>
> I think what I don't understand is how to manully set up an array of
> structures similarly to what the csv mapper does.
> If meeting in person is faster, would be very glad to meet.
>
> Any advice,
> Much appreciated.
>
> Uri
>
More information about the Swift-devel
mailing list