OSDN Git Service

Modify: for setting to SN ratio about input of FNC. v2.0.2p0049
authorkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Fri, 24 Oct 2014 06:33:24 +0000 (15:33 +0900)
committerkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Fri, 24 Oct 2014 06:33:24 +0000 (15:33 +0900)
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

Small Tools/mrcImage/mrcImageFourierNeighborCorrelation/Makefile/Makefile
Small Tools/mrcImage/mrcImageFourierNeighborCorrelation/Makefile/Makefile-lib
TIPS/Gnuplot/Makefile/Makefile
TIPS/Gnuplot/Makefile/Makefile-lib

index e5af7c9..c02950d 100644 (file)
@@ -29,8 +29,12 @@ FNC=txt
 # Path of Input File
 INPUT_PATH=${EOS_HOME}/tutorial/SampleData/1VOM-N.mrc
 
+### SN or NS for Input file
+INI_SN=1
+INI_NS=
+
 ### FileData
-FILE_NAME=Input
+FILE_NAME=Input$(INI_SN)$(INI_NS)
 
 ### ForMask
 MASK_F_MODE=4
@@ -54,6 +58,7 @@ E_DATA=2
 # Defined at Sub basically
 Initial::
        make InitialData;
+       make InitialDataNoiseAdd;
        make InputInfo;
        make MaskBackImage;
        make InputBackImage;
index 0d6277e..fba08c0 100644 (file)
@@ -14,6 +14,7 @@
 -include ${EOS_HOME}/tutorial/TIPS/ASCII/Makefile/Makefile-lib
 -include ${EOS_HOME}/tutorial/TIPS/Gnuplot/Makefile/Makefile-lib
 -include ${EOS_HOME}/tutorial/TIPS/Projection3DImage/Makefile/Makefile-lib
+-include ${EOS_HOME}/tutorial/TIPS/NoiseAdd/Makefile/Makefile-lib
 
 #### Definition ####
 # Defined at Main
@@ -35,6 +36,21 @@ InitialData::
        $(RM) $(FILE_NAME).$(INI);
        ln -s $(INPUT_PATH) $(FILE_NAME).$(INI);
 
+InitialDataNoiseAdd::
+       @export NOISE_IN_FILE_NAME=$(FILE_NAME); \
+       export IN_NOISE=$(INI); \
+       if [ ! -z "$(INI_SN)" ] ; then \
+               echo "Add Noise SN=$(INI_SN)"; \
+               export NOISE_SN=$(INI_SN); \
+               make NoiseAdd; \
+       elif [ ! -z "$(INI_NS)" ] ; then \
+               echo "Add Noise NS=$(INI_NS)"; \
+               export NOISE_NS=$(INI_NS); \
+               make NoiseAdd; \
+       else \
+               echo "Not Add Noise."; \
+       fi;
+
 InputInfo::
        make $(FILE_NAME).$(INI)info;
        
index b2aece7..d64ebbe 100644 (file)
@@ -10,7 +10,6 @@ INI=mrc
 IN_GNU=txt
 GNU_X_SIZE=480
 GNU_Y_SIZE=480
-GNU_Z_SIZE=480
 
 #### Suffixes rule ####
 # Defined at Sub
@@ -36,7 +35,8 @@ Initial::
 #      $(RM) $(FILE_NAME).$(INI);
 #      ln -s $(INPUT_PATH) $(FILE_NAME).$(INI);
        mrcImageGaussDisc -o "$(FILE_NAME).$(INI)" 
-       mrcImageInfo -i "$(FILE_NAME).$(INI)" -x -o "$(FILE_NAME)-2d.$(IN_GNU)";
+       mrcImageInfo -i "$(FILE_NAME).$(INI)" -x -o "$(FILE_NAME)-2dx.$(IN_GNU)";
+       mrcImageInfo -i "$(FILE_NAME).$(INI)" -y -o "$(FILE_NAME)-2dy.$(IN_GNU)";
        mrcImageMakeDump -i "$(FILE_NAME).$(INI)" -o "$(FILE_NAME)-3d.$(IN_GNU)";
 
 Exe::
@@ -44,7 +44,7 @@ Exe::
        make Exe3D;
 
 Exe2D::
-       @export IN_GNU_FILE_NAME=$(FILE_NAME)-2d; \
+       @export IN_GNU_FILE_NAME="$(FILE_NAME)-2dx $(FILE_NAME)-2dy"; \
        export OUT_GNU_FILE_NAME=$(FILE_NAME)-2d; \
        export OUT_GNU=png; \
        export VIEW_GNU_FILE_NAME=2D; \
index 2bc4c68..45cb5dc 100644 (file)
@@ -22,55 +22,89 @@ G_PLOT_EXE="${GNUPLOT_PATH}gnuplot"
 
 ##### Commands #####
 gnuplot2D::
-       @if [ ! -z $(G_PLOT_EXE) -a ! -z "$(IN_GNU_FILE_NAME).$(IN_GNU)" ] ; then \
+       @if [ ! -z $(G_PLOT_EXE) -a ! -z "$(IN_GNU_FILE_NAME)" -a ! -z "$(IN_GNU)" ] ; then \
                if [ ! -z "$(GNU_X_SIZE)" -a ! -z "$(GNU_Y_SIZE)" -a ! -z "$(OUT_GNU_FILE_NAME)" -a ! -z "$(OUT_GNU)" ] ; then \
                        OPTION1="set terminal png size $(GNU_X_SIZE), $(GNU_Y_SIZE); set output '$(OUT_GNU_FILE_NAME).$(OUT_GNU)' ;"; \
                else \
                        OPTION2="pause -1 ;" ; \
                fi; \
-               if [ -z "$(VIEW_GNU_FILE_NAME)" ] ; then \
-                       VIEW_GNU_FILE_NAME="$(IN_GNU_FILE_NAME).$(IN_GNU)"; \
-               else \
-                       $(RM) $(VIEW_GNU_FILE_NAME); \
-                       ln -s "$(IN_GNU_FILE_NAME).$(IN_GNU)" $(VIEW_GNU_FILE_NAME); \
-                       VIEW_GNU_FILE_NAME=$(VIEW_GNU_FILE_NAME); \
-               fi; \
-               $(G_PLOT_EXE) -e " \
-               $$OPTION1 \
-               plot '$$VIEW_GNU_FILE_NAME' ; \
-               $$OPTION2 \
-               "; \
-               $(RM) $(VIEW_GNU_FILE_NAME); \
+               $(G_PLOT_EXE) -e "$${OPTION1} plot $$(make gnuplotSet) $${OPTION2}" ; \
                echo "success gnuplot2D"; \
        else \
                echo "failed gnuplot2D"; \
        fi;
-
+       
 gnuplot3D::
-       @if [ ! -z $(G_PLOT_EXE) -a ! -z "$(IN_GNU_FILE_NAME).$(IN_GNU)" ] ; then \
-               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 \
+       @if [ ! -z $(G_PLOT_EXE) -a ! -z "$(IN_GNU_FILE_NAME)" -a ! -z "$(IN_GNU)" ] ; then \
+               if [ ! -z "$(GNU_X_SIZE)" -a ! -z "$(GNU_Y_SIZE)" -a ! -z "$(OUT_GNU_FILE_NAME)" -a ! -z "$(OUT_GNU)" ] ; then \
                        OPTION1="set terminal png size $(GNU_X_SIZE), $(GNU_Y_SIZE); set output '$(OUT_GNU_FILE_NAME).$(OUT_GNU)' ;"; \
                else \
                        OPTION2="pause -1 ;" ; \
                fi; \
-               if [ -z "$(VIEW_GNU_FILE_NAME)" ] ; then \
-                       VIEW_GNU_FILE_NAME="$(IN_GNU_FILE_NAME).$(IN_GNU)"; \
-               else \
-                       $(RM) $(VIEW_GNU_FILE_NAME); \
-                       ln -s "$(IN_GNU_FILE_NAME).$(IN_GNU)" $(VIEW_GNU_FILE_NAME); \
-                       VIEW_GNU_FILE_NAME=$(VIEW_GNU_FILE_NAME); \
-               fi; \
-               $(G_PLOT_EXE) -e " \
-               $$OPTION1 \
-               splot '$$VIEW_GNU_FILE_NAME' ; \
-               $$OPTION2 \
-               "; \
-               $(RM) $(VIEW_GNU_FILE_NAME); \
+               $(G_PLOT_EXE) -e "$${OPTION1} splot $$(make gnuplotSet) $${OPTION2}" ; \
                echo "success gnuplot3D"; \
        else \
                echo "failed gnuplot3D"; \
        fi;
 
+gnuplotSet::
+       @declare infile=( $(IN_GNU_FILE_NAME) ); \
+       infilenum=$${#infile[@]}; \
+       declare inext=( $(IN_GNU) ); \
+       inextnum=$${#inext[@]}; \
+       declare viewname=( $(VIEW_GNU_FILE_NAME) ); \
+       viewnum=$${#view[@]}; \
+       if [ $$infilenum -le 1 ] ; then \
+               for (( num = 0 ; $$num < $$inextnum ; num++ )) ; \
+               do \
+                       fileext="$$infile.$${inext[$$num]}"; \
+                       if [ $$num -le $$viewnum ] ; then \
+                               view="$${viewname[$$num]}"; \
+                               $(RM) $$view; \
+                               ln -s "$$fileext" $$view; \
+                       else \
+                               view="$$fileext"; \
+                       fi; \
+                       if [ ! -z "$${OPTION3}" ] ; then \
+                               OPTION3="$${OPTION3} ,"; \
+                       fi; \
+                       OPTION3="$${OPTION3} $${view}'"; \
+               done; \
+       elif [ $$inextnum -le 1 ] ; then \
+               for (( num = 0 ; $$num < $$infilenum ; num++ )) ; \
+               do \
+                       fileext="$${infile[$$num]}.$$inext"; \
+                       if [ $$num -le $$viewnum ] ; then \
+                               view="$${viewname[$$num]}"; \
+                               $(RM) $$view; \
+                               ln -s "$$fileext" $$view; \
+                       else \
+                               view="$$fileext"; \
+                       fi; \
+                       if [ ! -z "$${OPTION3}" ] ; then \
+                               OPTION3="$${OPTION3} ,"; \
+                       fi; \
+                       OPTION3="$${OPTION3} '$${view}'"; \
+               done; \
+       else \
+               for (( num = 0 ; $$num < $$infilenum ; num++ )) ; \
+               do \
+                       fileext="$${infile[$$num]}.$${inext[$$num]}"; \
+                       if [ $$num -le $$viewnum ] ; then \
+                               view="$${viewname[$$num]}"; \
+                               $(RM) $$view; \
+                               ln -s "$$fileext" $$view; \
+                       else \
+                               view="$$fileext"; \
+                       fi; \
+                       if [ ! -z "$${OPTION3}" ] ; then \
+                               OPTION3="$${OPTION3} ,"; \
+                       fi; \
+                       OPTION3="$${OPTION3} '$${view}'"; \
+               done; \
+       fi; \
+       echo "$${OPTION3} ;";
+
 help_Gnuplot::
        @echo
        @echo "Gnuplot"
@@ -83,17 +117,16 @@ help_Gnuplot::
        @echo
        @echo " (Setting Data):"
        @echo "         G_PLOT_PATH:            gnuplot application directory path in this lib file.(Essential)"
-       @echo "         IN_GNU_FILE_NAME:       input file name."
-       @echo "         IN_GNU:                 input file extention."
+       @echo "         IN_GNU_FILE_NAME:       input file names as Array.(if it has 1 data only, all data is treated as it.)"
+       @echo "         IN_GNU:                 input file extentions as Array.(if it has 1 data only, all data is treated as it.)"
        @echo "         (Note) Input file is required to be 2D or 3D that is delimited by space or tab."
        @echo "         ====== If the following is set, output the image. ======"
        @echo "         OUT_GNU_FILE_NAME:      output file name."
        @echo "         OUT_GNU:                output file extention."
        @echo "         GNU_X_SIZE:             output tiff size x"
        @echo "         GNU_Y_SIZE:             output tiff size y"
-       @echo "         GNU_Z_SIZE:             output tiff size z"
        @echo "         ====== Option ======"
-       @echo "         VIEW_GNU_FILE_NAME:             displayfile name on gnuplot."
+       @echo "         VIEW_GNU_FILE_NAME:     displayfile names on gnuplot as Array."
        @echo
 
 ##### Commands(Input to Output) #####