• R/O
  • HTTP
  • SSH
  • HTTPS

tutorial: Commit

This repository is for tutorials of Eos.


Commit MetaInfo

Revision484efbaf2b173ec41b2652e1056c1b05d9b855ee (tree)
Time2015-01-27 17:47:51
Authorkinoshita-eos <kinoshita@yasu...>
Commiterkinoshita-eos

Log Message

Add: PIONE tutorial to convert from Makefile.
new file: SampleCode/PIONE/Advanced4/Anotation.pione
new file: SampleCode/PIONE/Advanced4/Create_3d.pione
new file: SampleCode/PIONE/Advanced4/Create_3d4s.pione
new file: SampleCode/PIONE/Advanced4/Create_3d4slst.pione
new file: SampleCode/PIONE/Advanced4/Create_3dlst.pione
new file: SampleCode/PIONE/Advanced4/Create_3dwhole.pione
new file: SampleCode/PIONE/Advanced4/Create_3dwholelst.pione
new file: SampleCode/PIONE/Advanced4/Create_SampleROI.pione
new file: SampleCode/PIONE/Advanced4/Create_fit.pione
new file: SampleCode/PIONE/Advanced4/Create_stack.pione
new file: SampleCode/PIONE/Advanced4/Main.pione
new file: SampleCode/PIONE/Advanced4/Parameter.pione
new file: SampleCode/PIONE/Advanced4/Preprocess.pione
new file: SampleCode/PIONE/Advanced4/Projection_3d.pione

Change Summary

Incremental Difference

--- /dev/null
+++ b/SampleCode/PIONE/Advanced4/Anotation.pione
@@ -0,0 +1,5 @@
1+.@ PackageName :: "SingleParticle_3DReconstruction"
2+.@ Editor :: "Kinoshita"
3+.@ Tag :: "v0.0.0"
4+# Ref: Makefile in Eos v2.1.16p0093
5+# $EOS_HOME/Integration/SingleParticle/Makefile-fromKanae
\ No newline at end of file
--- /dev/null
+++ b/SampleCode/PIONE/Advanced4/Create_3d.pione
@@ -0,0 +1,28 @@
1+Rule Create_3d
2+ input '*.3dlst'
3+ input '*.fit'.all
4+ output '{$I[1][1]}.3d'
5+ output '{$I[1][1]}.3dcounter'
6+ output '{$I[1][1]}.ds6'
7+Flow
8+ rule Reconstruct_3dlst_3d
9+ rule Convert_3d_ds6
10+End
11+
12+#.3dlst.3d:
13+Rule Reconstruct_3dlst_3d
14+ input '*.3dlst'
15+ input '*.fit'.all
16+ output '{$I[1][1]}.3d'
17+ output '{$I[1][1]}.3dcounter'
18+Action
19+ mrc2Dto3D -I {$I[1]} -o {$O[1]} -InterpolationMode 2 -Double -DoubleCounter {$O[2]} -CounterThreshold 0.5 -m 1 -WeightMode 6
20+End
21+
22+#.3d.ds6:
23+Rule Convert_3d_ds6
24+ input '*.3d'
25+ output '{$I[1][1]}.ds6'
26+Action
27+ mrc2map -i {$I[1]} -o {$O[1]} -m 3
28+End
\ No newline at end of file
--- /dev/null
+++ b/SampleCode/PIONE/Advanced4/Create_3d4s.pione
@@ -0,0 +1,31 @@
1+Rule Create_3d4s
2+ input '*.3d4slst'
3+ input '*.4shift'.all
4+ output '{$I[1][1]}.3d4s'
5+ output '{$I[1][1]}.3d4scounter'
6+ output '{$I[1][1]}.4sds6'
7+ output '{$I[1][1]}.4s.ds6'
8+Flow
9+ rule Reconstruct_3d4slst_3d4s
10+ rule Convert_3d4s_4sds6
11+End
12+
13+#.3d4sinfolst.3d4s:
14+Rule Reconstruct_3d4slst_3d4s
15+ input '*.3d4slst'
16+ input '*.4shift'.all
17+ output '{$I[1][1]}.3d4s'
18+ output '{$I[1][1]}.3d4scounter'
19+Action
20+ mrc2Dto3D -I {$I[1]} -o {$O[1]} -InterpolationMode 2 -Double -DoubleCounter {$O[2]} -CounterThreshold 0.5 -m 1 -WeightMode 6
21+End
22+
23+#.3d4s.4sds6:
24+Rule Convert_3d4s_4sds6
25+ input '*.3d4s'
26+ output '{$I[1][1]}.4sds6'
27+ output '{$I[1][1]}.4s.ds6'
28+Action
29+ mrc2map -i {$I[1]} -o {$O[1]} -m 3
30+ ln -sf {$O[1]} {$O[2]}
31+End
--- /dev/null
+++ b/SampleCode/PIONE/Advanced4/Create_3d4slst.pione
@@ -0,0 +1,43 @@
1+Rule Create_3d4slst
2+ input '*.lst'
3+ input '*.roi'.all
4+ input '*.corinfo'.all
5+ output '{$I[1][1]}.3d4slst'
6+ output '*.4shift'.all
7+Flow
8+ rule fit_3d4sinfo
9+ rule Sum_3d4sinfo_3d4slst
10+End
11+
12+#.fit.3d4sinfo:
13+Rule fit_3d4sinfo
14+ input '*.corinfo'
15+ input '{$I[1][1]}.roi'
16+ output '{$I[1][1]}.3d4sinfolst'
17+ output '{$I[1][1]}.3d4sinfo'
18+ output '{$I[1][1]}.4shrink'
19+ output '{$I[1][1]}.4spad'
20+ output '{$I[1][1]}.4shift'
21+Action
22+ awk '/Cor/ { print $18,$16,$2,$3,$4,$9,$11,$12}' {$I[1]} | sort -r | sed -e s/pad/4shift/ > {$O[1]}
23+ head -n 1 {$O[1]} | awk ' {print $2,$3,$4,$5,$6,$7,$8,$1'} > {$O[2]}
24+ X=`awk '{print -{$SHRINK4S}*$6; }' {$O[2]}`; \
25+ Y=`awk '{print -{$SHRINK4S}*$7; }' {$O[2]}`; \
26+ echo $X,$Y;
27+ mrcImageShrink -i {$I[2]} -o {$O[3]} -S {$SHRINK4S}
28+ width=`expr {$X_SIZE} / {$SHRINK4S}`
29+ height=`expr {$Y_SIZE} / {$SHRINK4S}`
30+ mrcImagePad -i {$O[3]} -o {$O[4]} -W ${width} -H ${height}
31+ mrcImageShift -i {$I[2]} -o {$O[5]} -x $X -y $Y -z 0
32+End
33+
34+Rule Sum_3d4sinfo_3d4slst
35+ input '*.lst'
36+ input '*.3d4sinfo'.all
37+ output '{$I[1][1]}.3d4slst'
38+Action
39+ for info in {$I[2].join()}
40+ do
41+ cat $info >> {$O[1]}
42+ done
43+End
--- /dev/null
+++ b/SampleCode/PIONE/Advanced4/Create_3dlst.pione
@@ -0,0 +1,29 @@
1+Rule Create_3dlst
2+ input '*.lst'
3+ input '*.corinfo'.all
4+ output '{$I[1][1]}.3dlst'
5+Flow
6+ rule fit_3dinfo
7+ rule Sum_3dinfo_3dlst
8+End
9+
10+# .fit.3dinfo:
11+Rule fit_3dinfo
12+ input '*.corinfo'
13+ output '{$I[1][1]}.3dinfolst'
14+ output '{$I[1][1]}.3dinfo'
15+Action
16+ awk '/Cor/ { print $18,$16,$2,$3,$4,"0.0"}' {$I[1]} | sort -r | sed -e s/pad/fit/ > {$O[1]}
17+ head -n 1 {$O[1]} | awk ' {print $2,$3,$4,$5,$6,$1'} > {$O[2]}
18+End
19+
20+Rule Sum_3dinfo_3dlst
21+ input '*.lst'
22+ input '*.3dinfo'.all
23+ output '{$I[1][1]}.3dlst'
24+Action
25+ for info in {$I[2].join()}
26+ do
27+ cat $info >> {$O[1]}
28+ done
29+End
--- /dev/null
+++ b/SampleCode/PIONE/Advanced4/Create_3dwhole.pione
@@ -0,0 +1,31 @@
1+Rule Create_3dwhole
2+ input '*.3dwholelst'
3+ input '*.shift'.all
4+ output '{$I[1][1]}.3dwhole'
5+ output '{$I[1][1]}.3dwholecounter'
6+ output '{$I[1][1]}.wholeds6'
7+ output '{$I[1][1]}.whole.ds6'
8+Flow
9+ rule Reconstruct_3dwholelst_3dwhole
10+ rule Convert_3dwhole_wholeds6
11+End
12+
13+#.3dwholelst.3dwhole:
14+Rule Reconstruct_3dwholelst_3dwhole
15+ input '*.3dwholelst'
16+ input '*.shift'.all
17+ output '{$I[1][1]}.3dwhole'
18+ output '{$I[1][1]}.3dwholecounter'
19+Action
20+ mrc2Dto3D -I {$I[1]} -o {$O[1]} -InterpolationMode 2 -Double -DoubleCounter {$O[2]} -CounterThreshold 0.5 -m 1 -WeightMode 6
21+End
22+
23+#.3dwhole.3dwholelst:
24+Rule Convert_3dwhole_wholeds6
25+ input '*.3dwhole'
26+ output '{$I[1][1]}.wholeds6'
27+ output '{$I[1][1]}.whole.ds6'
28+Action
29+ mrc2map -i {$I[1]} -o {$O[1]} -m 3
30+ ln -sf {$O[1]} {$O[2]}
31+End
--- /dev/null
+++ b/SampleCode/PIONE/Advanced4/Create_3dwholelst.pione
@@ -0,0 +1,36 @@
1+Rule Create_3dwholelst
2+ input '*.lst'
3+ input '*.roi'.all
4+ input '*.corinfo'.all
5+ output '{$I[1][1]}.3dwholelst'
6+ output '*.shift'.all
7+Flow
8+ rule fit_3dwholeinfo
9+ rule Sum_3dwholeinfo_3dwholelst
10+End
11+
12+#.fit.3dwholeinfo:
13+Rule fit_3dwholeinfo
14+ input '*.roi'
15+ input '{$I[1][1]}.corinfo'
16+ output '{$I[1][1]}.3dwholeinfolst'
17+ output '{$I[1][1]}.3dwholeinfo'
18+ output '{$I[1][1]}.shift'
19+Action
20+ awk '/Cor/ { print $18,$16,$2,$3,$4,$9,$11,$12}' {$I[2]} | sort -r | sed -e s/pad/shift/ > {$O[1]}
21+ head -n 1 {$O[1]} | awk ' {print $2,$3,$4,$5,$6,$7,$8,$1'} > {$O[2]}
22+ X=`awk '{print -{$SHRINK}*$6; }' {$O[2]}`;
23+ Y=`awk '{print -{$SHRINK}*$7; }' {$O[2]}`;
24+ echo $X,$Y; mrcImageShift -i {$I[1]} -o {$O[3]} -x $X -y $Y -z 0
25+End
26+
27+Rule Sum_3dwholeinfo_3dwholelst
28+ input '*.lst'
29+ input '*.3dwholeinfo'.all
30+ output '{$I[1][1]}.3dwholelst'
31+Action
32+ for info in {$I[2].join()}
33+ do
34+ cat $info >> {$O[1]}
35+ done
36+End
\ No newline at end of file
--- /dev/null
+++ b/SampleCode/PIONE/Advanced4/Create_SampleROI.pione
@@ -0,0 +1,57 @@
1+Rule Create_SampleROI
2+ input '*.mrc'
3+ output '{$I[1][1]}.lst'
4+ output '{$I[1][1]}-*.roi'.all
5+ output '{$I[1][1]}-*.tiff'.all
6+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+
40+ for (( rot1 = {$ROI_ROT1_START}; rot1 <= {$ROI_ROT1_END}; rot1 += {$ROI_ROT1_DELTA} ))
41+ do
42+ for (( rot2 = {$ROI_ROT2_START}; rot2 <= {$ROI_ROT2_END}; rot2 += {$ROI_ROT2_DELTA} ))
43+ do
44+ for (( rot3 = {$ROI_ROT3_START}; rot3 <= {$ROI_ROT3_END}; rot3 += {$ROI_ROT3_DELTA} ))
45+ 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
50+ mrcImageNoiseAdd -i {$I[1][1]}-${rot1}-${rot2}-${rot3}.data2d -o {$I[1][1]}-${rot1}-${rot2}-${rot3}.roi -SN {$ROI_SN}
51+ mrc2tiff -i {$I[1][1]}-${rot1}-${rot2}-${rot3}.roi -o {$I[1][1]}-${rot1}-${rot2}-${rot3}.tiff
52+ done
53+ done
54+ done
55+
56+ ls *.roi > {$O[1]}
57+End
--- /dev/null
+++ b/SampleCode/PIONE/Advanced4/Create_fit.pione
@@ -0,0 +1,10 @@
1+#.pad.fit:
2+Rule Create_fit
3+ input '*.pad'
4+ input '*.stack'
5+ output '{$I[1][1]}.fit'
6+ output '{$I[1][1]}.corinfo'
7+Action
8+ mrcImageAutoRotationCorrelation -i {$I[1]} -r {$I[2]} -fit {$O[1]} -O {$O[2]} \
9+ -n {$N_ROT} -m 18 -nRot1 {$N_ROT1} -nRot2 {$N_ROT2} -nRot3 {$N_ROT3} > /dev/null
10+End
\ No newline at end of file
--- /dev/null
+++ b/SampleCode/PIONE/Advanced4/Create_stack.pione
@@ -0,0 +1,42 @@
1+Rule Create_stack
2+ input '*.mrc'
3+ output '{$I[1][1]}.stack'
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=15.7; ${length} * {$SHRINK} * ${ref_size} / ${image_size}" | bc)
35+
36+ mrcImageSamplingUnitChange -i {$I[1]} -o {$I[1][1]}.ref3d -m 2 -S ${sampling_length} ${sampling_length} ${sampling_length}
37+
38+ mrc3Dto2D -i {$I[1][1]}.ref3d -o {$O[1]} -m 1 -InterpolationMode 2 -EulerMode {$REF_ROT_MODE} \
39+ -Rot1 {$REF_ROT1_START} {$REF_ROT1_END} {$REF_ROT1_DELTA} \
40+ -Rot2 {$REF_ROT2_START} {$REF_ROT2_END} {$REF_ROT2_DELTA} \
41+ -Rot3 {$REF_ROT3_START} {$REF_ROT3_END} {$REF_ROT3_DELTA}
42+End
--- /dev/null
+++ b/SampleCode/PIONE/Advanced4/Main.pione
@@ -0,0 +1,70 @@
1+Rule Main
2+ if $Flag_ROI or $Flag_Ref
3+ input '*.mrc'
4+ end
5+
6+ if $Flag_ROI.not()
7+ input '*.lst'
8+ input '*.roi'.all
9+ end
10+
11+ if $Flag_Ref.not()
12+ input '*.stack'
13+ end
14+
15+ if $Flag_3D
16+ output '{$I[1][1]}.3dlst'
17+ output '{$I[1][1]}.3d'
18+ output '{$I[1][1]}.ds6'
19+ end
20+
21+ if $Flag_3DWhole
22+ output '{$I[1][1]}.3dwholelst'
23+ output '{$I[1][1]}.3dwhole'
24+ output '{$I[1][1]}.wholeds6'
25+ output '{$I[1][1]}.whole.ds6'
26+ end
27+
28+ if $Flag_3D4S
29+ output '{$I[1][1]}.3d4slst'
30+ output '{$I[1][1]}.3d4s'
31+ output '{$I[1][1]}.4sds6'
32+ output '{$I[1][1]}.4s.ds6'
33+ end
34+
35+ if $Flag_ROI
36+ output '*.tiff'.all
37+ end
38+
39+ output '*.gif'.all
40+
41+Flow
42+
43+ if $Flag_ROI
44+ rule Create_SampleROI
45+ end
46+
47+ if $Flag_Ref
48+ rule Create_stack
49+ end
50+
51+ rule Preprocess
52+ rule Create_fit
53+
54+ if $Flag_3D
55+ rule Create_3dlst
56+ rule Create_3d
57+ end
58+
59+ if $Flag_3DWhole
60+ rule Create_3dwholelst
61+ rule Create_3dwhole
62+ end
63+
64+ if $Flag_3D4S
65+ rule Create_3d4slst
66+ rule Create_3d4s
67+ end
68+
69+ rule Projection_3d
70+End
--- /dev/null
+++ b/SampleCode/PIONE/Advanced4/Parameter.pione
@@ -0,0 +1,44 @@
1+# basic param
2+## For Size
3+param $X_SIZE := 80
4+param $Y_SIZE := 80
5+param $SHRINK := 8
6+param $SHRINK4S := 4
7+
8+## For AutoRotationCorrelation
9+param $N_ROT := 72
10+param $N_ROT1 := 72
11+param $N_ROT2 := 72
12+param $N_ROT3 := 1
13+
14+## For RefData
15+param $REF_ROT_MODE := "XOYS"
16+param $REF_ROT1_START := 0
17+param $REF_ROT1_END := 359
18+param $REF_ROT1_DELTA := 15
19+param $REF_ROT2_START := 0
20+param $REF_ROT2_END := 359
21+param $REF_ROT2_DELTA := 15
22+param $REF_ROT3_START := 0
23+param $REF_ROT3_END := 0
24+param $REF_ROT3_DELTA := 15
25+
26+## For SampleROI
27+param $ROI_ROT_MODE := "XOYS"
28+param $ROI_ROT1_START := 0
29+param $ROI_ROT1_END := 359
30+param $ROI_ROT1_DELTA := 30
31+param $ROI_ROT2_START := 0
32+param $ROI_ROT2_END := 359
33+param $ROI_ROT2_DELTA := 30
34+param $ROI_ROT3_START := 0
35+param $ROI_ROT3_END := 0
36+param $ROI_ROT3_DELTA := 30
37+param $ROI_SN := 1
38+
39+# advanced param
40+advanced param $Flag_ROI := true
41+advanced param $Flag_Ref := true
42+advanced param $Flag_3D := true
43+advanced param $Flag_3DWhole := true
44+advanced param $Flag_3D4S := true
--- /dev/null
+++ b/SampleCode/PIONE/Advanced4/Preprocess.pione
@@ -0,0 +1,46 @@
1+# .lst.padlst:
2+Rule Preprocess
3+ input '*.lst'
4+ input '*.roi'.all
5+ output '*.pad'.all
6+ output '{$I[1][1]}.padlst'
7+Flow
8+ rule roi_smooth;
9+ rule smooth_shrink;
10+ rule shrink_pad;
11+ rule pad_padlst;
12+End
13+
14+#.roi.smooth:
15+Rule roi_smooth
16+ input '*.roi'
17+ output '{$I[1][1]}.smooth'
18+Action
19+ mrcImageSmoothing -i {$I[1]} -o {$O[1]} -m 1 -r 4
20+End
21+
22+#.smooth.shrink:
23+Rule smooth_shrink
24+ input '*.smooth'
25+ output '{$I[1][1]}.shrink'
26+Action
27+ mrcImageShrink -i {$I[1]} -o {$O[1]} -S {$SHRINK}
28+End
29+
30+#.shrink.pad:
31+Rule shrink_pad
32+ input '*.shrink'
33+ output '{$I[1][1]}.pad'
34+Action
35+ width=`expr {$X_SIZE} / {$SHRINK}`
36+ height=`expr {$Y_SIZE} / {$SHRINK}`
37+ mrcImagePad -i {$I[1]} -o {$O[1]} -W ${width} -H ${height}
38+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
--- /dev/null
+++ b/SampleCode/PIONE/Advanced4/Projection_3d.pione
@@ -0,0 +1,10 @@
1+Rule Projection_3d
2+ input '*.3d' or '*.3dwhole' or '*.3d4s'
3+ output '{$I[1]}-*.gif'.all
4+Action
5+ for i in 0 1 2
6+ do
7+ mrcImageProjection -i {$I[1]} -o {$I[1]}-$i.mrc -m $i
8+ mrc2gif -i {$I[1]}-$i.mrc -o {$I[1]}-$i.gif
9+ done
10+End
\ No newline at end of file
Show on old repository browser