• R/O
  • HTTP
  • SSH
  • HTTPS

tutorial: Commit

This repository is for tutorials of Eos.


Commit MetaInfo

Revisionfe784a0ee4ae55491f24aee5d1d95343c424fb5e (tree)
Time2014-10-24 15:33:24
Authorkinoshita-eos <kinoshita@yasu...>
Commiterkinoshita-eos

Log Message

Modify: for setting to SN ratio about input of FNC.
modified: Small Tools/mrcImage/mrcImageFourierNeighborCorrelation/Makefile/Makefile
modified: Small Tools/mrcImage/mrcImageFourierNeighborCorrelation/Makefile/Makefile-lib

Modify: Support the viewer for multiple files on gnuplot.
modified: TIPS/Gnuplot/Makefile/Makefile
modified: TIPS/Gnuplot/Makefile/Makefile-lib

Change Summary

Incremental Difference

--- a/Small Tools/mrcImage/mrcImageFourierNeighborCorrelation/Makefile/Makefile
+++ b/Small Tools/mrcImage/mrcImageFourierNeighborCorrelation/Makefile/Makefile
@@ -29,8 +29,12 @@ FNC=txt
2929 # Path of Input File
3030 INPUT_PATH=${EOS_HOME}/tutorial/SampleData/1VOM-N.mrc
3131
32+### SN or NS for Input file
33+INI_SN=1
34+INI_NS=
35+
3236 ### FileData
33-FILE_NAME=Input
37+FILE_NAME=Input$(INI_SN)$(INI_NS)
3438
3539 ### ForMask
3640 MASK_F_MODE=4
@@ -54,6 +58,7 @@ E_DATA=2
5458 # Defined at Sub basically
5559 Initial::
5660 make InitialData;
61+ make InitialDataNoiseAdd;
5762 make InputInfo;
5863 make MaskBackImage;
5964 make InputBackImage;
--- a/Small Tools/mrcImage/mrcImageFourierNeighborCorrelation/Makefile/Makefile-lib
+++ b/Small Tools/mrcImage/mrcImageFourierNeighborCorrelation/Makefile/Makefile-lib
@@ -14,6 +14,7 @@
1414 -include ${EOS_HOME}/tutorial/TIPS/ASCII/Makefile/Makefile-lib
1515 -include ${EOS_HOME}/tutorial/TIPS/Gnuplot/Makefile/Makefile-lib
1616 -include ${EOS_HOME}/tutorial/TIPS/Projection3DImage/Makefile/Makefile-lib
17+-include ${EOS_HOME}/tutorial/TIPS/NoiseAdd/Makefile/Makefile-lib
1718
1819 #### Definition ####
1920 # Defined at Main
@@ -35,6 +36,21 @@ InitialData::
3536 $(RM) $(FILE_NAME).$(INI);
3637 ln -s $(INPUT_PATH) $(FILE_NAME).$(INI);
3738
39+InitialDataNoiseAdd::
40+ @export NOISE_IN_FILE_NAME=$(FILE_NAME); \
41+ export IN_NOISE=$(INI); \
42+ if [ ! -z "$(INI_SN)" ] ; then \
43+ echo "Add Noise SN=$(INI_SN)"; \
44+ export NOISE_SN=$(INI_SN); \
45+ make NoiseAdd; \
46+ elif [ ! -z "$(INI_NS)" ] ; then \
47+ echo "Add Noise NS=$(INI_NS)"; \
48+ export NOISE_NS=$(INI_NS); \
49+ make NoiseAdd; \
50+ else \
51+ echo "Not Add Noise."; \
52+ fi;
53+
3854 InputInfo::
3955 make $(FILE_NAME).$(INI)info;
4056
--- a/TIPS/Gnuplot/Makefile/Makefile
+++ b/TIPS/Gnuplot/Makefile/Makefile
@@ -10,7 +10,6 @@ INI=mrc
1010 IN_GNU=txt
1111 GNU_X_SIZE=480
1212 GNU_Y_SIZE=480
13-GNU_Z_SIZE=480
1413
1514 #### Suffixes rule ####
1615 # Defined at Sub
@@ -36,7 +35,8 @@ Initial::
3635 # $(RM) $(FILE_NAME).$(INI);
3736 # ln -s $(INPUT_PATH) $(FILE_NAME).$(INI);
3837 mrcImageGaussDisc -o "$(FILE_NAME).$(INI)"
39- mrcImageInfo -i "$(FILE_NAME).$(INI)" -x -o "$(FILE_NAME)-2d.$(IN_GNU)";
38+ mrcImageInfo -i "$(FILE_NAME).$(INI)" -x -o "$(FILE_NAME)-2dx.$(IN_GNU)";
39+ mrcImageInfo -i "$(FILE_NAME).$(INI)" -y -o "$(FILE_NAME)-2dy.$(IN_GNU)";
4040 mrcImageMakeDump -i "$(FILE_NAME).$(INI)" -o "$(FILE_NAME)-3d.$(IN_GNU)";
4141
4242 Exe::
@@ -44,7 +44,7 @@ Exe::
4444 make Exe3D;
4545
4646 Exe2D::
47- @export IN_GNU_FILE_NAME=$(FILE_NAME)-2d; \
47+ @export IN_GNU_FILE_NAME="$(FILE_NAME)-2dx $(FILE_NAME)-2dy"; \
4848 export OUT_GNU_FILE_NAME=$(FILE_NAME)-2d; \
4949 export OUT_GNU=png; \
5050 export VIEW_GNU_FILE_NAME=2D; \
--- a/TIPS/Gnuplot/Makefile/Makefile-lib
+++ b/TIPS/Gnuplot/Makefile/Makefile-lib
@@ -22,55 +22,89 @@ G_PLOT_EXE="${GNUPLOT_PATH}gnuplot"
2222
2323 ##### Commands #####
2424 gnuplot2D::
25- @if [ ! -z $(G_PLOT_EXE) -a ! -z "$(IN_GNU_FILE_NAME).$(IN_GNU)" ] ; then \
25+ @if [ ! -z $(G_PLOT_EXE) -a ! -z "$(IN_GNU_FILE_NAME)" -a ! -z "$(IN_GNU)" ] ; then \
2626 if [ ! -z "$(GNU_X_SIZE)" -a ! -z "$(GNU_Y_SIZE)" -a ! -z "$(OUT_GNU_FILE_NAME)" -a ! -z "$(OUT_GNU)" ] ; then \
2727 OPTION1="set terminal png size $(GNU_X_SIZE), $(GNU_Y_SIZE); set output '$(OUT_GNU_FILE_NAME).$(OUT_GNU)' ;"; \
2828 else \
2929 OPTION2="pause -1 ;" ; \
3030 fi; \
31- if [ -z "$(VIEW_GNU_FILE_NAME)" ] ; then \
32- VIEW_GNU_FILE_NAME="$(IN_GNU_FILE_NAME).$(IN_GNU)"; \
33- else \
34- $(RM) $(VIEW_GNU_FILE_NAME); \
35- ln -s "$(IN_GNU_FILE_NAME).$(IN_GNU)" $(VIEW_GNU_FILE_NAME); \
36- VIEW_GNU_FILE_NAME=$(VIEW_GNU_FILE_NAME); \
37- fi; \
38- $(G_PLOT_EXE) -e " \
39- $$OPTION1 \
40- plot '$$VIEW_GNU_FILE_NAME' ; \
41- $$OPTION2 \
42- "; \
43- $(RM) $(VIEW_GNU_FILE_NAME); \
31+ $(G_PLOT_EXE) -e "$${OPTION1} plot $$(make gnuplotSet) $${OPTION2}" ; \
4432 echo "success gnuplot2D"; \
4533 else \
4634 echo "failed gnuplot2D"; \
4735 fi;
48-
36+
4937 gnuplot3D::
50- @if [ ! -z $(G_PLOT_EXE) -a ! -z "$(IN_GNU_FILE_NAME).$(IN_GNU)" ] ; then \
51- if [ ! -z "$(GNU_X_SIZE)" -a ! -z "$(GNU_Y_SIZE)" -a ! -z "$(GNU_Z_SIZE)" -a ! -z "$(OUT_GNU_FILE_NAME)" -a ! -z "$(OUT_GNU)" ] ; then \
38+ @if [ ! -z $(G_PLOT_EXE) -a ! -z "$(IN_GNU_FILE_NAME)" -a ! -z "$(IN_GNU)" ] ; then \
39+ if [ ! -z "$(GNU_X_SIZE)" -a ! -z "$(GNU_Y_SIZE)" -a ! -z "$(OUT_GNU_FILE_NAME)" -a ! -z "$(OUT_GNU)" ] ; then \
5240 OPTION1="set terminal png size $(GNU_X_SIZE), $(GNU_Y_SIZE); set output '$(OUT_GNU_FILE_NAME).$(OUT_GNU)' ;"; \
5341 else \
5442 OPTION2="pause -1 ;" ; \
5543 fi; \
56- if [ -z "$(VIEW_GNU_FILE_NAME)" ] ; then \
57- VIEW_GNU_FILE_NAME="$(IN_GNU_FILE_NAME).$(IN_GNU)"; \
58- else \
59- $(RM) $(VIEW_GNU_FILE_NAME); \
60- ln -s "$(IN_GNU_FILE_NAME).$(IN_GNU)" $(VIEW_GNU_FILE_NAME); \
61- VIEW_GNU_FILE_NAME=$(VIEW_GNU_FILE_NAME); \
62- fi; \
63- $(G_PLOT_EXE) -e " \
64- $$OPTION1 \
65- splot '$$VIEW_GNU_FILE_NAME' ; \
66- $$OPTION2 \
67- "; \
68- $(RM) $(VIEW_GNU_FILE_NAME); \
44+ $(G_PLOT_EXE) -e "$${OPTION1} splot $$(make gnuplotSet) $${OPTION2}" ; \
6945 echo "success gnuplot3D"; \
7046 else \
7147 echo "failed gnuplot3D"; \
7248 fi;
7349
50+gnuplotSet::
51+ @declare infile=( $(IN_GNU_FILE_NAME) ); \
52+ infilenum=$${#infile[@]}; \
53+ declare inext=( $(IN_GNU) ); \
54+ inextnum=$${#inext[@]}; \
55+ declare viewname=( $(VIEW_GNU_FILE_NAME) ); \
56+ viewnum=$${#view[@]}; \
57+ if [ $$infilenum -le 1 ] ; then \
58+ for (( num = 0 ; $$num < $$inextnum ; num++ )) ; \
59+ do \
60+ fileext="$$infile.$${inext[$$num]}"; \
61+ if [ $$num -le $$viewnum ] ; then \
62+ view="$${viewname[$$num]}"; \
63+ $(RM) $$view; \
64+ ln -s "$$fileext" $$view; \
65+ else \
66+ view="$$fileext"; \
67+ fi; \
68+ if [ ! -z "$${OPTION3}" ] ; then \
69+ OPTION3="$${OPTION3} ,"; \
70+ fi; \
71+ OPTION3="$${OPTION3} $${view}'"; \
72+ done; \
73+ elif [ $$inextnum -le 1 ] ; then \
74+ for (( num = 0 ; $$num < $$infilenum ; num++ )) ; \
75+ do \
76+ fileext="$${infile[$$num]}.$$inext"; \
77+ if [ $$num -le $$viewnum ] ; then \
78+ view="$${viewname[$$num]}"; \
79+ $(RM) $$view; \
80+ ln -s "$$fileext" $$view; \
81+ else \
82+ view="$$fileext"; \
83+ fi; \
84+ if [ ! -z "$${OPTION3}" ] ; then \
85+ OPTION3="$${OPTION3} ,"; \
86+ fi; \
87+ OPTION3="$${OPTION3} '$${view}'"; \
88+ done; \
89+ else \
90+ for (( num = 0 ; $$num < $$infilenum ; num++ )) ; \
91+ do \
92+ fileext="$${infile[$$num]}.$${inext[$$num]}"; \
93+ if [ $$num -le $$viewnum ] ; then \
94+ view="$${viewname[$$num]}"; \
95+ $(RM) $$view; \
96+ ln -s "$$fileext" $$view; \
97+ else \
98+ view="$$fileext"; \
99+ fi; \
100+ if [ ! -z "$${OPTION3}" ] ; then \
101+ OPTION3="$${OPTION3} ,"; \
102+ fi; \
103+ OPTION3="$${OPTION3} '$${view}'"; \
104+ done; \
105+ fi; \
106+ echo "$${OPTION3} ;";
107+
74108 help_Gnuplot::
75109 @echo
76110 @echo "Gnuplot"
@@ -83,17 +117,16 @@ help_Gnuplot::
83117 @echo
84118 @echo " (Setting Data):"
85119 @echo " G_PLOT_PATH: gnuplot application directory path in this lib file.(Essential)"
86- @echo " IN_GNU_FILE_NAME: input file name."
87- @echo " IN_GNU: input file extention."
120+ @echo " IN_GNU_FILE_NAME: input file names as Array.(if it has 1 data only, all data is treated as it.)"
121+ @echo " IN_GNU: input file extentions as Array.(if it has 1 data only, all data is treated as it.)"
88122 @echo " (Note) Input file is required to be 2D or 3D that is delimited by space or tab."
89123 @echo " ====== If the following is set, output the image. ======"
90124 @echo " OUT_GNU_FILE_NAME: output file name."
91125 @echo " OUT_GNU: output file extention."
92126 @echo " GNU_X_SIZE: output tiff size x"
93127 @echo " GNU_Y_SIZE: output tiff size y"
94- @echo " GNU_Z_SIZE: output tiff size z"
95128 @echo " ====== Option ======"
96- @echo " VIEW_GNU_FILE_NAME: displayfile name on gnuplot."
129+ @echo " VIEW_GNU_FILE_NAME: displayfile names on gnuplot as Array."
97130 @echo
98131
99132 ##### Commands(Input to Output) #####
Show on old repository browser