[Swift-commit] r4766 - SwiftApps/SwiftMontage/scripts
jonmon at ci.uchicago.edu
jonmon at ci.uchicago.edu
Tue Jul 5 13:03:34 CDT 2011
Author: jonmon
Date: 2011-07-05 13:03:34 -0500 (Tue, 05 Jul 2011)
New Revision: 4766
Added:
SwiftApps/SwiftMontage/scripts/SwiftMontage_Apps.swift
SwiftApps/SwiftMontage/scripts/SwiftMontage_Batch.swift
Removed:
SwiftApps/SwiftMontage/scripts/SwiftMontage_Apps.swft
SwiftApps/SwiftMontage/scripts/SwiftMontage_Batch.swft
SwiftApps/SwiftMontage/scripts/copy_image.sh
Log:
o fixed extension on the Apps and Batch file.
o minor edits to the Batch file
o removed copy_image.sh - do not use it
Deleted: SwiftApps/SwiftMontage/scripts/SwiftMontage_Apps.swft
===================================================================
--- SwiftApps/SwiftMontage/scripts/SwiftMontage_Apps.swft 2011-07-05 18:01:06 UTC (rev 4765)
+++ SwiftApps/SwiftMontage/scripts/SwiftMontage_Apps.swft 2011-07-05 18:03:34 UTC (rev 4766)
@@ -1,98 +0,0 @@
-app ( Image mos ) mAdd( Image imgs[], Table img_tbl, Header hdr )
-{
- mAdd "-p" @dirname( imgs[0] ) "-n" @img_tbl @hdr @mos;
-}
-
-
-app ( Image rc_img ) mBackground( Image img, float a, float b, float c )
-{
- mBackground "-n" @img @rc_img a b c;
-}
-
-
-app ( Table rect_tbl ) mBgModel( Table img_tbl, Table fits_tbl )
-{
- mBgModel @img_tbl @fits_tbl @rect_tbl;
-}
-
-
-app ( Table fits_tbl ) mConcatFit( Table status_tbl, Status stats[] )
-{
- mConcatFit @status_tbl @fits_tbl @dirname( stats[0] );
-}
-
-
-app ( Image diff_img ) mDiff( Image proj_img_1, Image proj_img_2, Header hdr )
-{
- mDiff_wrap "-n" @proj_img_1 @proj_img_2 @diff_img @hdr;
-}
-
-
-app ( Image diff_img, Status stat ) mDiffFit( Image img_1, Image img_2, Header hdr )
-{
- mDiffFit_wrap "-n" "-s" @stat @img_1 @img_2 @diff_img @hdr;
-}
-
-
-app ( Status stat ) mFitplane( Image diff_img )
-{
- mFitplane_wrap "-s" @stat @diff_img;
-}
-
-
-app ( Table img_tbl ) mImgtbl( Image imgs[] )
-{
- mImgtbl @dirname( imgs[0] ) @img_tbl;
-}
-
-
-app ( Header hdr ) mMakeHdr( Table img_tbl )
-{
- mMakeHdr @img_tbl @hdr;
-}
-
-
-app ( JPEG mos_img_jpg ) mJPEG( Image mos_img )
-{
- mJPEG "-gray" @mos_img "20%" "99.98%" "loglog" "-out" @mos_img_jpg;
-}
-
-
-app ( Table diff_tbl ) mOverlaps( Table img_tbl )
-{
- mOverlaps @img_tbl @diff_tbl;
-}
-
-
-app ( Image proj_img ) mProjectPP( Image raw_img, Header hdr )
-{
- mProjectPP "-X" @raw_img @proj_img @hdr;
-}
-
-
-app ( Image proj_img ) mProject( Image raw_img, Header hdr )
-{
- mProject "-X" @raw_img @proj_img @hdr;
-}
-
-app ( Image shrunk ) mShrink( Image original, int factor )
-{
- mShrink @original @shrunk factor;
-}
-
-/*----------------------------------------------------------------------------------*/
-/* */
-/* Util Scripts */
-/* */
-/*----------------------------------------------------------------------------------*/
-
-app ( Table back_tbl ) Background_list( Table imgs_tbl, Table rects_tbl )
-{
- Background_list @imgs_tbl @rects_tbl @back_tbl;
-}
-
-
-app ( Table stat_tbl ) create_status_table( Table diff_tbl )
-{
- create_status_table @diff_tbl @stat_tbl;
-}
Copied: SwiftApps/SwiftMontage/scripts/SwiftMontage_Apps.swift (from rev 4764, SwiftApps/SwiftMontage/scripts/SwiftMontage_Apps.swft)
===================================================================
--- SwiftApps/SwiftMontage/scripts/SwiftMontage_Apps.swift (rev 0)
+++ SwiftApps/SwiftMontage/scripts/SwiftMontage_Apps.swift 2011-07-05 18:03:34 UTC (rev 4766)
@@ -0,0 +1,98 @@
+app ( Image mos ) mAdd( Image imgs[], Table img_tbl, Header hdr )
+{
+ mAdd "-p" @dirname( imgs[0] ) "-n" @img_tbl @hdr @mos;
+}
+
+
+app ( Image rc_img ) mBackground( Image img, float a, float b, float c )
+{
+ mBackground "-n" @img @rc_img a b c;
+}
+
+
+app ( Table rect_tbl ) mBgModel( Table img_tbl, Table fits_tbl )
+{
+ mBgModel @img_tbl @fits_tbl @rect_tbl;
+}
+
+
+app ( Table fits_tbl ) mConcatFit( Table status_tbl, Status stats[] )
+{
+ mConcatFit @status_tbl @fits_tbl @dirname( stats[0] );
+}
+
+
+app ( Image diff_img ) mDiff( Image proj_img_1, Image proj_img_2, Header hdr )
+{
+ mDiff_wrap "-n" @proj_img_1 @proj_img_2 @diff_img @hdr;
+}
+
+
+app ( Image diff_img, Status stat ) mDiffFit( Image img_1, Image img_2, Header hdr )
+{
+ mDiffFit_wrap "-n" "-s" @stat @img_1 @img_2 @diff_img @hdr;
+}
+
+
+app ( Status stat ) mFitplane( Image diff_img )
+{
+ mFitplane_wrap "-s" @stat @diff_img;
+}
+
+
+app ( Table img_tbl ) mImgtbl( Image imgs[] )
+{
+ mImgtbl @dirname( imgs[0] ) @img_tbl;
+}
+
+
+app ( Header hdr ) mMakeHdr( Table img_tbl )
+{
+ mMakeHdr @img_tbl @hdr;
+}
+
+
+app ( JPEG mos_img_jpg ) mJPEG( Image mos_img )
+{
+ mJPEG "-gray" @mos_img "20%" "99.98%" "loglog" "-out" @mos_img_jpg;
+}
+
+
+app ( Table diff_tbl ) mOverlaps( Table img_tbl )
+{
+ mOverlaps @img_tbl @diff_tbl;
+}
+
+
+app ( Image proj_img ) mProjectPP( Image raw_img, Header hdr )
+{
+ mProjectPP "-X" @raw_img @proj_img @hdr;
+}
+
+
+app ( Image proj_img ) mProject( Image raw_img, Header hdr )
+{
+ mProject "-X" @raw_img @proj_img @hdr;
+}
+
+app ( Image shrunk ) mShrink( Image original, int factor )
+{
+ mShrink @original @shrunk factor;
+}
+
+/*----------------------------------------------------------------------------------*/
+/* */
+/* Util Scripts */
+/* */
+/*----------------------------------------------------------------------------------*/
+
+app ( Table back_tbl ) Background_list( Table imgs_tbl, Table rects_tbl )
+{
+ Background_list @imgs_tbl @rects_tbl @back_tbl;
+}
+
+
+app ( Table stat_tbl ) create_status_table( Table diff_tbl )
+{
+ create_status_table @diff_tbl @stat_tbl;
+}
Deleted: SwiftApps/SwiftMontage/scripts/SwiftMontage_Batch.swft
===================================================================
--- SwiftApps/SwiftMontage/scripts/SwiftMontage_Batch.swft 2011-07-05 18:01:06 UTC (rev 4765)
+++ SwiftApps/SwiftMontage/scripts/SwiftMontage_Batch.swft 2011-07-05 18:03:34 UTC (rev 4766)
@@ -1,88 +0,0 @@
-( Image rect_imgs[] ) mBackgroundBatch( string dest, Image imgs[], Table img_tbl, Table rect_tbl )
-{
- Table back_list = Background_list( img_tbl, rect_tbl );
-
- BackgroundStruct back_struct[] = readData2( back_list );
-
- foreach background_entry, i in back_struct
- {
- Image orig_img <single_file_mapper; file = @strcat( @dirname( imgs[i] )+"/", @background_entry.fname )>;
- Image rect_img <regexp_mapper; source = @orig_img, match = ".*\\/(.*)", transform = dest+"/\\1">;
-
- float a = background_entry.a;
- float b = background_entry.b;
- float c = background_entry.c;
- rect_img = mBackground( orig_img, a, b, c );
-
- rect_imgs[ i ] = rect_img;
- }
-}
-
-
-( Image diff_imgs[] ) mDiffBatch( string src, string dest, Table diff_tbl, Header hdr )
-{
- DiffStruct diffs[] <csv_mapper; file = diff_tbl, skip = 1, hdelim="| ">;
-
- foreach d_entry, i in diffs
- {
- Image img_1 <single_file_mapper; file = @strcat( src+"/", @d_entry.plus )>;
- Image img_2 <single_file_mapper; file = @strcat( src+"/", @d_entry.minus )>;
-
- Image diff_img <single_file_mapper; file = @strcat( dest+"/", @d_entry.diff )>;
- diff_img = mDiff( img_1, img_2, hdr );
-
- diff_imgs[ i ] = diff_img;
- }
-}
-
-
-( Image diff_imgs[], Table fits_tbl ) mDiffFitBatch( string src, string dest, string stat, string files[], Table diff_tbl, Header hdr )
-{
- DiffStruct diffs[] <csv_mapper; file = diff_tbl, skip = 1, hdelim="| ">;
- Status stats[];
-
- Table status_tbl = create_status_table( diff_tbl );
-
- foreach d_entry, i in diffs
- {
- Image img_1 <single_file_mapper; file = @strcat( src+"/", @d_entry.plus )>;
- Image img_2 <single_file_mapper; file = @strcat( src+"/", @d_entry.minus )>;
-
- Image diff_img <single_file_mapper; file = @strcat( dest+"/", @d_entry.diff )>;
- Status stat_file <single_file_mapper; file = stat+ at strcat( "/stat.", @d_entry.diff)>;
-
- ( diff_img, stat_file ) = mDiffFit( img_1, img_2, hdr );
-
- diff_imgs[ i ] = diff_img;
- stats[ i ] = stat_file;
- }
- fits_tbl = mConcatFit( status_tbl, stats );
-}
-
-
-( Table fits_tbl ) mFitBatch( string stat, Image diff_imgs[], Table diff_tbl )
-{
- Status stats[] <structured_regexp_mapper; source = diff_imgs, match = ".*\\/(.*)", transform = stat+"/stat.\\1">;
-
- Table status_tbl = create_status_table( diff_tbl );
-
- foreach img, i in stats
- {
- stats[ i ] = mFitplane ( diff_imgs[i] );
- }
-
- fits_tbl = mConcatFit( status_tbl, stats );
-}
-
-
-( Image proj_imgs[] ) mProjectBatch( string dest, Image raw_imgs[], Header hdr )
-{
- foreach img, i in raw_imgs
- {
- Image proj_img <regexp_mapper; source = @img, match = ".*\\/(.*)", transform = dest+"/proj_\\1">;
- proj_img = mProject( img, hdr );
-// proj_img = mProjectPP( img, hdr );
-
- proj_imgs[ i ] = proj_img;
- }
-}
Copied: SwiftApps/SwiftMontage/scripts/SwiftMontage_Batch.swift (from rev 4764, SwiftApps/SwiftMontage/scripts/SwiftMontage_Batch.swft)
===================================================================
--- SwiftApps/SwiftMontage/scripts/SwiftMontage_Batch.swift (rev 0)
+++ SwiftApps/SwiftMontage/scripts/SwiftMontage_Batch.swift 2011-07-05 18:03:34 UTC (rev 4766)
@@ -0,0 +1,88 @@
+( Image rect_imgs[] ) mBackgroundBatch( string dest, Image imgs[], Table img_tbl, Table rect_tbl )
+{
+ Table back_list = Background_list( img_tbl, rect_tbl );
+
+ BackgroundStruct back_struct[] = readData2( back_list );
+
+ foreach background_entry, i in back_struct
+ {
+ Image orig_img <single_file_mapper; file = @dirname( imgs[1] ) + "/" + @background_entry.fname>;
+ Image rect_img <regexp_mapper; source = @orig_img, match = ".*\\/(.*)", transform = dest+"/\\1">;
+
+ float a = background_entry.a;
+ float b = background_entry.b;
+ float c = background_entry.c;
+ rect_img = mBackground( orig_img, a, b, c );
+
+ rect_imgs[ i ] = rect_img;
+ }
+}
+
+
+( Image diff_imgs[] ) mDiffBatch( string src, string dest, Table diff_tbl, Header hdr )
+{
+ DiffStruct diffs[] <csv_mapper; file = diff_tbl, skip = 1, hdelim="| ">;
+
+ foreach d_entry, i in diffs
+ {
+ Image img_1 <single_file_mapper; file = src + "/" + @d_entry.plus>;
+ Image img_2 <single_file_mapper; file = src + "/" + @d_entry.minus>;
+
+ Image diff_img <single_file_mapper; file = dest + "/" + @d_entry.diff>;
+ diff_img = mDiff( img_1, img_2, hdr );
+
+ diff_imgs[ i ] = diff_img;
+ }
+}
+
+
+( Image diff_imgs[], Table fits_tbl ) mDiffFitBatch( string src, string dest, string stat, string files[], Table diff_tbl, Header hdr )
+{
+ DiffStruct diffs[] <csv_mapper; file = diff_tbl, skip = 1, hdelim="| ">;
+ Status stats[];
+
+ Table status_tbl = create_status_table( diff_tbl );
+
+ foreach d_entry, i in diffs
+ {
+ Image img_1 <single_file_mapper; file = src + "/" + @d_entry.plus>;
+ Image img_2 <single_file_mapper; file = src + "/" + @d_entry.minus>;
+
+ Image diff_img <single_file_mapper; file = dest + "/" + @d_entry.diff>;
+ Status stat_file <single_file_mapper; file = stat + "/stat." + d_entry.diff>;
+
+ ( diff_img, stat_file ) = mDiffFit( img_1, img_2, hdr );
+
+ diff_imgs[ i ] = diff_img;
+ stats[ i ] = stat_file;
+ }
+ fits_tbl = mConcatFit( status_tbl, stats );
+}
+
+
+( Table fits_tbl ) mFitBatch( string stat, Image diff_imgs[], Table diff_tbl )
+{
+ Status stats[] <structured_regexp_mapper; source = diff_imgs, match = ".*\\/(.*)", transform = stat + "/stat.\\1">;
+
+ Table status_tbl = create_status_table( diff_tbl );
+
+ foreach img, i in stats
+ {
+ stats[ i ] = mFitplane ( diff_imgs[i] );
+ }
+
+ fits_tbl = mConcatFit( status_tbl, stats );
+}
+
+
+( Image proj_imgs[] ) mProjectBatch( string dest, Image raw_imgs[], Header hdr )
+{
+ foreach img, i in raw_imgs
+ {
+ Image proj_img <regexp_mapper; source = @img, match = ".*\\/(.*)", transform = dest + "/proj_\\1">;
+ proj_img = mProject( img, hdr );
+// proj_img = mProjectPP( img, hdr );
+
+ proj_imgs[ i ] = proj_img;
+ }
+}
Deleted: SwiftApps/SwiftMontage/scripts/copy_image.sh
===================================================================
--- SwiftApps/SwiftMontage/scripts/copy_image.sh 2011-07-05 18:01:06 UTC (rev 4765)
+++ SwiftApps/SwiftMontage/scripts/copy_image.sh 2011-07-05 18:03:34 UTC (rev 4766)
@@ -1,3 +0,0 @@
-#!/bin/bash
-
-cp $2 $1
\ No newline at end of file
More information about the Swift-commit
mailing list