[Swift-devel] Re: arrays of structures and building them in SWIFT

Uri Hasson uhasson at gmail.com
Sun May 4 18:30:51 CDT 2008


Hi all, thanks for the Sunday help.

I tried the simple mapper, but not go.
The short buggy SWIFT script is here:
http://www.ci.uchicago.edu/~uhasson/AFNIsnrV3.swift

The input directory contains
S05.runbyrun.reg_TS_run-1+orig.BRIK
S05.runbyrun.reg_TS_run-1+orig.HEAD
S05.runbyrun.reg_TS_run-2+orig.BRIK
S05.runbyrun.reg_TS_run-2+orig.HEAD
S05.runbyrun.reg_TS_run-3+orig.BRIK
S05.runbyrun.reg_TS_run-3+orig.HEAD

I hoped that as a result of the simple_mapper,
sruns[0].HEAD==S05.runbyrun.reg_TS_run-1+orig.HEAD
sruns[0].BRIK==S05.runbyrun.reg_TS_run-1+orig.BRIK
(I tried reading via both prefix and pattern methods in the mapper)

However, I get an error:
Execution failed:
        org.griphyn.vdl.mapping.InvalidPathException: Invalid path ([0]) for
type AFNI_obj[]

log file:
/disks/gpfs/fmri/cnari/swift/projects/uhasson/AFNIflows/SNR/AFNIsnrV3-20080504-1826-37q86081.log

Also, is there any print() or trace() command I could use to see whether
sruns was assigned the correct values?
I tried print(@filenames(sruns[0])),
print(@filename(sruns[0].HEAD))
but am not getting anything meaningful.

Best,
Uri

On Sun, May 4, 2008 at 5:31 PM, Ben Clifford <benc at hawaga.org.uk> wrote:

>
> > E.g., if the directory contains
> >
> > file1.Head file1.BRIK, file2.Head file2.BRIK
> >
> > The mapper will map files to my complex type:
> > mytype t;
> > t[0].head = file1.HEAD
> > t[0].brik = file1.BRIK
> > t[1].head = file2.BRIK
> > t[1].brik = file2.BRIK
> > and I will be able to pass this to calls as MyCall(t[0])
> > [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?]
>
> You should be able to map this with simple_mapper too. Something like
> this:
>
> type t { file HEAD; file BRIK; }
> t inp[] <simple_mapper;prefix="file">;
>
> > 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.
>
> This bit I'll think about - similar, but not the same, stuff has been done
> before.
>
> --
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/swift-devel/attachments/20080504/ce59556b/attachment.html>


More information about the Swift-devel mailing list