OSDN Git Service

Modify: PIONE tutorial of Loop Statement version-up with upto. v2.0.2p0093
authorkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Thu, 22 Jan 2015 03:02:42 +0000 (12:02 +0900)
committerkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Thu, 22 Jan 2015 03:02:42 +0000 (12:02 +0900)
modified:   SampleCode/PIONE/Advanced3/Annotation.pione
modified:   SampleCode/PIONE/Advanced3/Ref3DtoRef2D.pione

SampleCode/PIONE/Advanced3/Annotation.pione
SampleCode/PIONE/Advanced3/Ref3DtoRef2D.pione

index fea8311..37de193 100644 (file)
@@ -1,3 +1,3 @@
 .@ PackageName :: "Ref3DtoRef2D"
 .@ Editor              :: "Kinoshita"
-.@ Tag                 :: "v0.1.1"
+.@ Tag                 :: "v0.2.0"
index 3a1a2dc..19983b8 100644 (file)
 Rule Ref3DtoRef2D
-       input '*.!*-{$val}'.all
-       input '*.ref3d-{$val}'
-       output '*.ref2d-{$val}'.all
-       output 'Ref3DtoRef2D.info-{$val}'
-       param $val
-Flow
-       rule FlowLoop3Dto2D1 {val : $val}
-       rule Info3Dto2D {val : $val}
-End
-
-Rule Info3Dto2D
-       input '*.ref2d-{$val}'.all
-       output 'Ref3DtoRef2D.info-{$val}'
-       param $val
-Action
-       for file in $(ls *.ref2d-{$val})
-       do
-               echo "./$file" >> {$O[1]}
-       done
-End
-
-Rule FlowLoop3Dto2D1
        input '*!*!*.!Rot1-{$val}'
        input '*!*!*.!Rot2-{$val}'
        input '*!*!*.!Rot3-{$val}'
        input '*.!Mode-{$val}'
        input '*.ref3d-{$val}'
        output '*.ref2d-{$val}'.all
+       output 'Ref3DtoRef2D.info-{$val}'
        $min1 := '{$I[1][1]}'.str().f()
        $max1 := '{$I[1][2]}'.str().f()
        $delta1 := '{$I[1][3]}'.str().f()
-       $loop1 := ($max1 - $min1) / $delta1
-       param $val1 := 0.0
-       param $val
-Flow
-       rule FlowLoop3Dto2D2 {val1 : $val1, val :$val}
-
-       if $val1 + 1.0 <= $loop1
-               rule FlowLoop3Dto2D1 {val1 : $val1 + 1.0, val :$val}
-       end
-End
-
-Rule FlowLoop3Dto2D2
-       input '*!*!*.!Rot1-{$val}'
-       input '*!*!*.!Rot2-{$val}'
-       input '*!*!*.!Rot3-{$val}'
-       input '*.!Mode-{$val}'
-       input '*.ref3d-{$val}'
-       output '*.ref2d-{$val}'.all
+       $loop1 := (($max1 - $min1) / $delta1).i()
        $min2 := '{$I[2][1]}'.str().f()
        $max2 := '{$I[2][2]}'.str().f()
        $delta2 := '{$I[2][3]}'.str().f()
-       $loop2 := ($max2 - $min2) / $delta2
-       param $val1
-       param $val2 := 0.0
-       param $val
-Flow
-       rule FlowLoop3Dto2D3 {val1 : $val1, val2 : $val2, val :$val}
-
-       if $val2 + 1.0 <= $loop2
-               rule FlowLoop3Dto2D2 {val1 : $val1, val2 : $val2 + 1.0, val :$val}
-       end
-End
-
-Rule FlowLoop3Dto2D3
-       input '*!*!*.!Rot1-{$val}'
-       input '*!*!*.!Rot2-{$val}'
-       input '*!*!*.!Rot3-{$val}'
-       input '*.!Mode-{$val}'
-       input '*.ref3d-{$val}'
-       output '*.ref2d-{$val}'.all
+       $loop2 := (($max2 - $min2) / $delta2).i()
        $min3 := '{$I[3][1]}'.str().f()
        $max3 := '{$I[3][2]}'.str().f()
        $delta3 := '{$I[3][3]}'.str().f()
-       $loop3 := ($max3 - $min3) / $delta3
-       param $val1
-       param $val2
-       param $val3 := 0.0
+       $loop3 := (($max3 - $min3) / $delta3).i()
+       $mode := '{$I[4][1]}'.str()
        param $val
 Flow
-       rule One3Dto2D {val1 : $val1, val2 : $val2, val3 : $val3, val :$val}
+       rule One3Dto2D {rot1: $min1 + ((0.upto($loop1)).f() * $delta1), rot2: $min2 + ((0.upto($loop2)).f() * $delta2), rot3: $min3 + ((0.upto($loop3)).f() * $delta3), mode : $mode, val : $val}
+       rule Info3Dto2D {val : $val}
+End
 
-       if $val3 + 1.0 <= $loop3
-               rule FlowLoop3Dto2D3 {val1 : $val1, val2 : $val2, val3 : $val3 + 1.0, val :$val}
-       end
+Rule Info3Dto2D
+       input '*.ref2d-{$val}'.all
+       output 'Ref3DtoRef2D.info-{$val}'
+       param $val
+Action
+       for file in $(ls *.ref2d-{$val})
+       do
+               echo "./$file" >> {$O[1]}
+       done
 End
 
 Rule One3Dto2D
-       input '*!*!*.!Rot1-{$val}'
-       input '*!*!*.!Rot2-{$val}'
-       input '*!*!*.!Rot3-{$val}'
-       input '*.!Mode-{$val}'
        input '*.ref3d-{$val}'
        output '*.ref2d-{$val}'.all
-       param $val1
-       param $val2
-       param $val3
+       param $rot1
+       param $rot2
+       param $rot3
+       param $mode
        param $val
 Action
-       min1={$I[1][1]}
-       min2={$I[2][1]}
-       min3={$I[3][1]}
-       delta1={$I[1][3]}
-       delta2={$I[2][3]}
-       delta3={$I[3][3]}
-       mode={$I[4][1]}
-       rot1=$(echo "scale=5; {$val1} * $delta1 + $min1" | bc)
-       rot2=$(echo "scale=5; {$val2} * $delta2 + $min2" | bc)
-       rot3=$(echo "scale=5; {$val3} * $delta3 + $min3" | bc)
-       output="{$I[5][1]}-$mode-$rot1-$rot2-$rot3.ref2d-{$val}"
-       mrc3Dto2D       -i {$I[5]} -o $output \
-                               -Rot1 $rot1 $rot1 1 \
-                               -Rot2 $rot2 $rot2 1 \
-                               -Rot3 $rot3 $rot3 1 \
-                               -EulerMode $mode;
+       output="{$I[1][1]}-{$mode}-{$rot1}-{$rot2}-{$rot3}.ref2d-{$val}"
+       mrc3Dto2D       -i {$I[1]} -o $output \
+                               -Rot1 {$rot1} {$rot1} 1 \
+                               -Rot2 {$rot2} {$rot2} 1 \
+                               -Rot3 {$rot3} {$rot3} 1 \
+                               -EulerMode {$mode};
 End