• R/O
  • HTTP
  • SSH
  • HTTPS

tutorial: Commit

This repository is for tutorials of Eos.


Commit MetaInfo

Revision54d579faa5bdbae23271d931ac22758950d01fb1 (tree)
Time2015-01-28 14:19:21
Authorkinoshita-eos <kinoshita@yasu...>
Commiterkinoshita-eos

Log Message

Modify: PIONE tutorial Advanced4 use "each" and "all".
modified: SampleCode/PIONE/Advanced4/Create_3d4slst.pione
modified: SampleCode/PIONE/Advanced4/Create_3dlst.pione
modified: SampleCode/PIONE/Advanced4/Create_3dwholelst.pione
new file: SampleCode/PIONE/Advanced4/Create_Sample3d.pione
modified: SampleCode/PIONE/Advanced4/Create_SampleROI.pione
modified: SampleCode/PIONE/Advanced4/Create_fit.pione
modified: SampleCode/PIONE/Advanced4/Main.pione
modified: SampleCode/PIONE/Advanced4/Parameter.pione
modified: SampleCode/PIONE/Advanced4/Preprocess.pione

Change Summary

Incremental Difference

--- a/SampleCode/PIONE/Advanced4/Create_3d4slst.pione
+++ b/SampleCode/PIONE/Advanced4/Create_3d4slst.pione
@@ -1,12 +1,12 @@
11 Rule Create_3d4slst
2- input '*.lst'
32 input '*.roi'.all
43 input '*.corinfo'.all
5- output '{$I[1][1]}.3d4slst'
4+ output '{$filename}.3d4slst'
65 output '*.4shift'.all
6+ param $filename
77 Flow
88 rule fit_3d4sinfo
9- rule Sum_3d4sinfo_3d4slst
9+ rule Sum_3d4sinfo_3d4slst {filename: $filename}
1010 End
1111
1212 #.fit.3d4sinfo:
@@ -32,11 +32,11 @@ Action
3232 End
3333
3434 Rule Sum_3d4sinfo_3d4slst
35- input '*.lst'
3635 input '*.3d4sinfo'.all
37- output '{$I[1][1]}.3d4slst'
36+ output '{$filename}.3d4slst'
37+ param $filename
3838 Action
39- for info in {$I[2].join()}
39+ for info in {$I[1].join()}
4040 do
4141 cat $info >> {$O[1]}
4242 done
--- a/SampleCode/PIONE/Advanced4/Create_3dlst.pione
+++ b/SampleCode/PIONE/Advanced4/Create_3dlst.pione
@@ -1,10 +1,10 @@
11 Rule Create_3dlst
2- input '*.lst'
32 input '*.corinfo'.all
4- output '{$I[1][1]}.3dlst'
3+ output '{$filename}.3dlst'
4+ param $filename
55 Flow
66 rule fit_3dinfo
7- rule Sum_3dinfo_3dlst
7+ rule Sum_3dinfo_3dlst {filename: $filename}
88 End
99
1010 # .fit.3dinfo:
@@ -18,11 +18,11 @@ Action
1818 End
1919
2020 Rule Sum_3dinfo_3dlst
21- input '*.lst'
2221 input '*.3dinfo'.all
23- output '{$I[1][1]}.3dlst'
22+ output '{$filename}.3dlst'
23+ param $filename
2424 Action
25- for info in {$I[2].join()}
25+ for info in {$I[1].join()}
2626 do
2727 cat $info >> {$O[1]}
2828 done
--- a/SampleCode/PIONE/Advanced4/Create_3dwholelst.pione
+++ b/SampleCode/PIONE/Advanced4/Create_3dwholelst.pione
@@ -1,12 +1,12 @@
11 Rule Create_3dwholelst
2- input '*.lst'
32 input '*.roi'.all
43 input '*.corinfo'.all
5- output '{$I[1][1]}.3dwholelst'
4+ output '{$filename}.3dwholelst'
65 output '*.shift'.all
6+ param $filename
77 Flow
88 rule fit_3dwholeinfo
9- rule Sum_3dwholeinfo_3dwholelst
9+ rule Sum_3dwholeinfo_3dwholelst {filename: $filename}
1010 End
1111
1212 #.fit.3dwholeinfo:
@@ -25,11 +25,11 @@ Action
2525 End
2626
2727 Rule Sum_3dwholeinfo_3dwholelst
28- input '*.lst'
2928 input '*.3dwholeinfo'.all
30- output '{$I[1][1]}.3dwholelst'
29+ output '{$filename}.3dwholelst'
30+ param $filename
3131 Action
32- for info in {$I[2].join()}
32+ for info in {$I[1].join()}
3333 do
3434 cat $info >> {$O[1]}
3535 done
--- /dev/null
+++ b/SampleCode/PIONE/Advanced4/Create_Sample3d.pione
@@ -0,0 +1,37 @@
1+Rule Create_Sample3d
2+ input '*.mrc'
3+ output '{$I[1][1]}.sample3d'
4+Action
5+ data=$(mrcInfo -i {$I[1]} | head -1)
6+ x_size=$(echo "${data}" | awk '{printf ("%i", $4)}')
7+ y_size=$(echo "${data}" | awk '{printf ("%i", $5)}')
8+ z_size=$(echo "${data}" | awk '{printf ("%i", $6)}')
9+
10+ data=$(mrcInfo -i {$I[1]} | head -5 | tail -1)
11+ x_length=$(echo "${data}" | awk '{printf ("%f", $4)}')
12+ y_length=$(echo "${data}" | awk '{printf ("%f", $5)}')
13+ z_length=$(echo "${data}" | awk '{printf ("%f", $6)}')
14+
15+ ref_size=${x_size}
16+ length=${x_length}
17+
18+ if [ ${ref_size} -lt ${y_size} ] ; then \
19+ ref_size=${y_size}
20+ length=${y_length}
21+ fi
22+
23+ if [ ${ref_size} -lt ${z_size} ] ; then \
24+ ref_size=${z_size}
25+ length=${z_length}
26+ fi
27+
28+ image_size={$X_SIZE}
29+
30+ if [ ${image_size} -lt {$Y_SIZE} ] ; then \
31+ image_size={$Y_SIZE}
32+ fi
33+
34+ sampling_length=$(echo "scale=7; ${length} * ${ref_size} / ${image_size}" | bc)
35+
36+ mrcImageSamplingUnitChange -i {$I[1]} -o {$I[1][1]}.sample3d -m 2 -S ${sampling_length} ${sampling_length} ${sampling_length}
37+End
--- a/SampleCode/PIONE/Advanced4/Create_SampleROI.pione
+++ b/SampleCode/PIONE/Advanced4/Create_SampleROI.pione
@@ -1,57 +1,37 @@
1-Rule Create_SampleROI
2- input '*.mrc'
3- output '{$I[1][1]}.lst'
1+Rule Create_SampleROI_each
2+ input '*.sample3d'
3+ output '{$I[1][1]}-{$rot1}-{$rot2}-{$rot3}.roi'
4+ output '{$I[1][1]}-{$rot1}-{$rot2}-{$rot3}.tiff'
5+ param $rot1
6+ param $rot2
7+ param $rot3
8+Action
9+ mrc3Dto2D -i {$I[1]} -o {$I[1][1]}-{$rot1}-{$rot2}-{$rot3}.data2d -InterpolationMode 2 -EulerMode {$ROI_ROT_MODE} \
10+ -Rot1 {$rot1} {$rot1} 1 \
11+ -Rot2 {$rot2} {$rot2} 1 \
12+ -Rot3 {$rot3} {$rot3} 1
13+ mrcImageNoiseAdd -i {$I[1][1]}-{$rot1}-{$rot2}-{$rot3}.data2d -o {$O[1]} -SN {$ROI_SN}
14+ mrc2tiff -i {$O[1]} -o {$O[2]}
15+End
16+
17+Rule Create_SampleROI_all
18+ input '*.sample3d'
419 output '{$I[1][1]}-*.roi'.all
520 output '{$I[1][1]}-*.tiff'.all
621 Action
7- data=$(mrcInfo -i {$I[1]} | head -1)
8- x_size=$(echo "${data}" | awk '{printf ("%i", $4)}')
9- y_size=$(echo "${data}" | awk '{printf ("%i", $5)}')
10- z_size=$(echo "${data}" | awk '{printf ("%i", $6)}')
11-
12- data=$(mrcInfo -i {$I[1]} | head -5 | tail -1)
13- x_length=$(echo "${data}" | awk '{printf ("%f", $4)}')
14- y_length=$(echo "${data}" | awk '{printf ("%f", $5)}')
15- z_length=$(echo "${data}" | awk '{printf ("%f", $6)}')
16-
17- ref_size=${x_size}
18- length=${x_length}
19-
20- if [ ${ref_size} -lt ${y_size} ] ; then \
21- ref_size=${y_size}
22- length=${y_length}
23- fi
24-
25- if [ ${ref_size} -lt ${z_size} ] ; then \
26- ref_size=${z_size}
27- length=${z_length}
28- fi
29-
30- image_size={$X_SIZE}
31-
32- if [ ${image_size} -lt {$Y_SIZE} ] ; then \
33- image_size={$Y_SIZE}
34- fi
35-
36- sampling_length=$(echo "scale=7; ${length} * ${ref_size} / ${image_size}" | bc)
37-
38- mrcImageSamplingUnitChange -i {$I[1]} -o {$I[1][1]}.data3d -m 2 -S ${sampling_length} ${sampling_length} ${sampling_length}
39-
4022 for (( rot1 = {$ROI_ROT1_START}; rot1 <= {$ROI_ROT1_END}; rot1 += {$ROI_ROT1_DELTA} ))
4123 do
4224 for (( rot2 = {$ROI_ROT2_START}; rot2 <= {$ROI_ROT2_END}; rot2 += {$ROI_ROT2_DELTA} ))
4325 do
4426 for (( rot3 = {$ROI_ROT3_START}; rot3 <= {$ROI_ROT3_END}; rot3 += {$ROI_ROT3_DELTA} ))
4527 do
46- mrc3Dto2D -i {$I[1][1]}.data3d -o {$I[1][1]}-${rot1}-${rot2}-${rot3}.data2d -InterpolationMode 2 -EulerMode {$ROI_ROT_MODE} \
47- -Rot1 ${rot1} ${rot1} 1 \
48- -Rot2 ${rot2} ${rot2} 1 \
49- -Rot3 ${rot3} ${rot3} 1
28+ mrc3Dto2D -i {$I[1]} -o {$I[1][1]}-${rot1}-${rot2}-${rot3}.data2d -InterpolationMode 2 -EulerMode {$ROI_ROT_MODE} \
29+ -Rot1 ${rot1} ${rot1} 1 \
30+ -Rot2 ${rot2} ${rot2} 1 \
31+ -Rot3 ${rot3} ${rot3} 1
5032 mrcImageNoiseAdd -i {$I[1][1]}-${rot1}-${rot2}-${rot3}.data2d -o {$I[1][1]}-${rot1}-${rot2}-${rot3}.roi -SN {$ROI_SN}
5133 mrc2tiff -i {$I[1][1]}-${rot1}-${rot2}-${rot3}.roi -o {$I[1][1]}-${rot1}-${rot2}-${rot3}.tiff
5234 done
5335 done
5436 done
55-
56- ls *.roi > {$O[1]}
5737 End
--- a/SampleCode/PIONE/Advanced4/Create_fit.pione
+++ b/SampleCode/PIONE/Advanced4/Create_fit.pione
@@ -1,5 +1,5 @@
11 #.pad.fit:
2-Rule Create_fit
2+Rule Create_fit_each
33 input '*.pad'
44 input '*.stack'
55 output '{$I[1][1]}.fit'
@@ -7,4 +7,17 @@ Rule Create_fit
77 Action
88 mrcImageAutoRotationCorrelation -i {$I[1]} -r {$I[2]} -fit {$O[1]} -O {$O[2]} \
99 -n {$N_ROT} -m 18 -nRot1 {$N_ROT1} -nRot2 {$N_ROT2} -nRot3 {$N_ROT3} > /dev/null
10+End
11+
12+Rule Create_fit_all
13+ input '*.pad'.all
14+ input '*.stack'
15+ output '*.fit'.all
16+ output '*.corinfo'.all
17+Action
18+ for data in {$I[1][1]}
19+ do
20+ mrcImageAutoRotationCorrelation -i ${data}.pad -r {$I[2]} -fit ${data}.fit -O ${data}.corinfo \
21+ -n {$N_ROT} -m 18 -nRot1 {$N_ROT1} -nRot2 {$N_ROT2} -nRot3 {$N_ROT3} > /dev/null
22+ done
1023 End
\ No newline at end of file
--- a/SampleCode/PIONE/Advanced4/Main.pione
+++ b/SampleCode/PIONE/Advanced4/Main.pione
@@ -1,15 +1,14 @@
11 Rule Main
2- if $Flag_ROI or $Flag_Ref
2+ if ($Mode_ROI + $Mode_Ref) != 0
33 input '*.mrc'
44 end
55
6- if $Flag_ROI.not()
7- input '*.lst'
8- input '*.roi'.all
6+ if $Mode_Ref == 0
7+ input '*.stack'
98 end
109
11- if $Flag_Ref.not()
12- input '*.stack'
10+ if $Mode_ROI == 0
11+ input '*.roi'.all
1312 end
1413
1514 if $Flag_3D
@@ -32,39 +31,52 @@ Rule Main
3231 output '{$I[1][1]}.4s.ds6'
3332 end
3433
35- if $Flag_ROI
34+ if $Mode_ROI != 0
3635 output '*.tiff'.all
3736 end
3837
39- output '*.gif'.all
40-
38+ if $Flag_Projection
39+ output '*.gif'.all
40+ end
4141 Flow
42-
43- if $Flag_ROI
44- rule Create_SampleROI
42+ case $Mode_ROI
43+ when 1
44+ rule Create_Sample3d
45+ rule Create_SampleROI_each {rot1: (0.upto($roi_rot1_loop))*$ROI_ROT1_DELTA, rot2: (0.upto($roi_rot2_loop))*$ROI_ROT2_DELTA, rot3: (0.upto($roi_rot3_loop))*$ROI_ROT3_DELTA}
46+ when 2
47+ rule Create_Sample3d
48+ rule Create_SampleROI_all
4549 end
4650
47- if $Flag_Ref
51+ if $Mode_Ref != 0
4852 rule Create_stack
4953 end
5054
5155 rule Preprocess
52- rule Create_fit
56+
57+ case $Mode_Cor
58+ when 1
59+ rule Create_fit_each
60+ when 2
61+ rule Create_fit_all
62+ end
5363
5464 if $Flag_3D
55- rule Create_3dlst
65+ rule Create_3dlst {filename: $I[1][1].str()}
5666 rule Create_3d
5767 end
5868
5969 if $Flag_3DWhole
60- rule Create_3dwholelst
70+ rule Create_3dwholelst {filename: $I[1][1].str()}
6171 rule Create_3dwhole
6272 end
6373
6474 if $Flag_3D4S
65- rule Create_3d4slst
75+ rule Create_3d4slst {filename: $I[1][1].str()}
6676 rule Create_3d4s
6777 end
6878
69- rule Projection_3d
79+ if $Flag_Projection
80+ rule Projection_3d
81+ end
7082 End
--- a/SampleCode/PIONE/Advanced4/Parameter.pione
+++ b/SampleCode/PIONE/Advanced4/Parameter.pione
@@ -28,17 +28,24 @@ param $ROI_ROT_MODE := "XOYS"
2828 param $ROI_ROT1_START := 0
2929 param $ROI_ROT1_END := 359
3030 param $ROI_ROT1_DELTA := 30
31+$roi_rot1_loop := ($ROI_ROT1_END - $ROI_ROT1_START) / $ROI_ROT1_DELTA
3132 param $ROI_ROT2_START := 0
3233 param $ROI_ROT2_END := 359
3334 param $ROI_ROT2_DELTA := 30
35+$roi_rot2_loop := ($ROI_ROT2_END - $ROI_ROT2_START) / $ROI_ROT2_DELTA
3436 param $ROI_ROT3_START := 0
3537 param $ROI_ROT3_END := 0
3638 param $ROI_ROT3_DELTA := 30
39+$roi_rot3_loop := ($ROI_ROT3_END - $ROI_ROT3_START) / $ROI_ROT3_DELTA
3740 param $ROI_SN := 1
3841
3942 # advanced param
40-advanced param $Flag_ROI := true
41-advanced param $Flag_Ref := true
43+## Mode 0: do not, 1: each, 2: all
44+advanced param $Mode_ROI := 1
45+advanced param $Mode_Ref := 1
46+advanced param $Mode_Cor := 1
47+## Flag true: do, false: do not
4248 advanced param $Flag_3D := true
4349 advanced param $Flag_3DWhole := true
4450 advanced param $Flag_3D4S := true
51+advanced param $Flag_Projection := true
--- a/SampleCode/PIONE/Advanced4/Preprocess.pione
+++ b/SampleCode/PIONE/Advanced4/Preprocess.pione
@@ -1,14 +1,11 @@
11 # .lst.padlst:
22 Rule Preprocess
3- input '*.lst'
4- input '*.roi'.all
5- output '*.pad'.all
6- output '{$I[1][1]}.padlst'
3+ input '*.roi'
4+ output '{$I[1][1]}.pad'
75 Flow
86 rule roi_smooth;
97 rule smooth_shrink;
108 rule shrink_pad;
11- rule pad_padlst;
129 End
1310
1411 #.roi.smooth:
@@ -36,11 +33,3 @@ Action
3633 height=`expr {$Y_SIZE} / {$SHRINK}`
3734 mrcImagePad -i {$I[1]} -o {$O[1]} -W ${width} -H ${height}
3835 End
39-
40-Rule pad_padlst
41- input '*.lst'
42- input '*.pad'.all
43- output '{$I[1][1]}.padlst'
44-Action
45- echo "{$I[2].join("\\n")}" > {$O[1]}
46-End
Show on old repository browser