• R/O
  • HTTP
  • SSH
  • HTTPS

tutorial: Commit

This repository is for tutorials of Eos.


Commit MetaInfo

Revision2737a2da029a67fe2cf4a4b525c0fad687aba22d (tree)
Time2014-10-24 10:14:07
Authorkinoshita-eos <kinoshita@yasu...>
Commiterkinoshita-eos

Log Message

Add: TIPS to add noise to file.

new file: TIPS/NoiseAdd/Makefile/Makefile
new file: TIPS/NoiseAdd/Makefile/Makefile-lib

Modify: Add tutorial version to template Makefile
modified: Small Tools/Template/Makefile/Makefile
modified: Small Tools/Template/Makefile/Makefile-lib
modified: Small Tools/mrcImage/Makefile
modified: TIPS/Makefile
modified: TIPS/Template/Makefile/Makefile
modified: TIPS/Template/Makefile/Makefile-lib

Change Summary

Incremental Difference

--- a/Small Tools/Template/Makefile/Makefile
+++ b/Small Tools/Template/Makefile/Makefile
@@ -1,6 +1,8 @@
11 #
22 # This is Main Makefile for !!Command!!.
33 #
4+# Created by template !!Version!!
5+#
46
57 #### Root Makefile ####
68 MAKE_ROOT=!!Command!!
--- a/Small Tools/Template/Makefile/Makefile-lib
+++ b/Small Tools/Template/Makefile/Makefile-lib
@@ -1,6 +1,8 @@
11 #
22 # This is Sub Makefile for !!Command!!.
33 #
4+# Created by template !!Version!!
5+#
46
57 #### Input extention ####
68 # Defined at Main
--- a/Small Tools/mrcImage/Makefile
+++ b/Small Tools/mrcImage/Makefile
@@ -28,6 +28,7 @@ CreateInitialMakefileDirectory::
2828 @mkdir $$TARGET;
2929 @CLASS_NAME="mrcImage"; \
3030 GROUP_NAME="DataManip"; \
31+ T_VERSION=$$(git tag | tail -1); \
3132 cd ./$$TARGET; \
3233 mkdir Makefile; \
3334 cd ./Makefile; \
@@ -36,9 +37,9 @@ CreateInitialMakefileDirectory::
3637 sed -e s/"!!Command!!"/"$$TARGET"/g Makefile > tmp; \
3738 sed -e s/"!!Class!!"/"$$CLASS_NAME"/g tmp > Makefile; \
3839 sed -e s/"!!Group!!"/"$$GROUP_NAME"/g Makefile > tmp; \
39- cp tmp Makefile; \
40+ sed -e s/"!!Version!!"/"$$T_VERSION"/g tmp > Makefile; \
4041 sed -e s/"!!Command!!"/"$$TARGET"/g Makefile-lib > tmp; \
41- cp tmp Makefile-lib; \
42+ sed -e s/"!!Version!!"/"$$T_VERSION"/g tmp > Makefile-lib; \
4243 rm tmp;
4344 @echo succeed to create.
4445
--- a/TIPS/Makefile
+++ b/TIPS/Makefile
@@ -25,15 +25,16 @@ SOURCE="../../Template/Makefile/"
2525
2626 CreateInitialMakefileDirectory::
2727 @mkdir $$TARGET;
28- @cd ./$$TARGET; \
28+ @T_VERSION=$$(git tag | tail -1); \
29+ cd ./$$TARGET; \
2930 mkdir Makefile; \
3031 cd ./Makefile; \
3132 cp ${SOURCE}Makefile Makefile; \
3233 cp ${SOURCE}Makefile-lib Makefile-lib; \
3334 sed -e s/"!!Command!!"/"$$TARGET"/g Makefile > tmp; \
34- cp tmp Makefile; \
35+ sed -e s/"!!Version!!"/"$$T_VERSION"/g tmp > Makefile; \
3536 sed -e s/"!!Command!!"/"$$TARGET"/g Makefile-lib > tmp; \
36- cp tmp Makefile-lib; \
37+ sed -e s/"!!Version!!"/"$$T_VERSION"/g tmp > Makefile-lib; \
3738 rm tmp;
3839 @echo succeed to create.
3940
--- /dev/null
+++ b/TIPS/NoiseAdd/Makefile/Makefile
@@ -0,0 +1,66 @@
1+#
2+# This is Main Makefile for NoiseAdd.
3+#
4+
5+#### Root Makefile ####
6+MAKE_ROOT=NoiseAdd
7+
8+#### Input extention ####
9+INI=ini
10+
11+#### Suffixes rule ####
12+# Defined at Sub
13+
14+#### INCLUDE ####
15+# Help-include-file must always be put on top.
16+-include ${EOS_HOME}/tutorial/TIPS/Help/Makefile/Makefile-lib
17+-include ${EOS_HOME}/tutorial/TIPS/Projection3DImage/Makefile/Makefile-lib
18+-include Makefile-lib
19+
20+#### Definition ####
21+# Path of Input File
22+# Basically, use a linked data from /SampleData.
23+INPUT_PATH=${EOS_HOME}/tutorial/SampleData/1VOM.mrc
24+
25+### FileData
26+FILE_NAME=Input
27+
28+### For option of command
29+NOISE_SD=
30+NOISE_SN=
31+NOISE_NS=
32+NOISE_H_TRES=
33+NOISE_L_TRES=
34+
35+#### Rules of the list created ####
36+# Defined at Sub
37+
38+##### Commands #####
39+# Defined at Sub basically
40+Initial::
41+ $(RM) $(FILE_NAME).$(INI);
42+ ln -s $(INPUT_PATH) $(FILE_NAME).$(INI);
43+
44+Exe::
45+ export NOISE_IN_FILE_NAME=$(FILE_NAME); \
46+ export IN_NOISE=$(INI); \
47+ make NoiseAdd;
48+
49+Final::
50+ @export PRJ_FILE_NAME=$(FILE_NAME); \
51+ export IN_PRJ=$(INI); \
52+ export PRJ=$$IN_PRJ; \
53+ export OUT_PRJ="$$IN_PRJ".tiff; \
54+ make Projection3DImage; \
55+ export IN_PRJ=$(INI)back; \
56+ export PRJ=$$IN_PRJ; \
57+ export OUT_PRJ="$$IN_PRJ".tiff; \
58+ make Projection3DImage;
59+
60+all::
61+ make Initial;
62+ make Exe;
63+ make Final;
64+
65+##### Commands(Input to Output) #####
66+# Defined at Sub
--- /dev/null
+++ b/TIPS/NoiseAdd/Makefile/Makefile-lib
@@ -0,0 +1,77 @@
1+#
2+# This is Sub Makefile for NoiseAdd.
3+#
4+
5+#### Input extention ####
6+# Defined at Main
7+
8+#### Suffixes rule ####
9+
10+#### INCLUDE ####
11+# Use TIPS File.
12+# -include ${EOS_HOME}/tutorial/TIPS/XXXX/Makefile/Makefile-lib
13+
14+#### Definition ####
15+# Defined at Main
16+
17+#### Rules of the list created ####
18+
19+
20+##### Commands #####
21+NoiseAdd::
22+ @if [ -z "$(NOISE_OUT_FILE_NAME)" ] ; then \
23+ outfile="$(NOISE_IN_FILE_NAME)"; \
24+ else \
25+ outfile="$(NOISE_OUT_FILE_NAME)"; \
26+ fi; \
27+ if [ -z "$(OUT_NOISE)" ] ; then \
28+ outext="$(IN_NOISE)"; \
29+ else \
30+ outext="$(OUT_NOISE)"; \
31+ fi; \
32+ if [ "$$outfile""$$outext" = "$(NOISE_IN_FILE_NAME)""$(IN_NOISE)" ] ; then \
33+ inext="$(IN_NOISE)back"; \
34+ mv "$(NOISE_IN_FILE_NAME)"."$(IN_NOISE)" "$(NOISE_IN_FILE_NAME)"."$$inext"; \
35+ else \
36+ inext="$(IN_NOISE)"; \
37+ fi; \
38+ if [ ! -z "$(NOISE_SD)" ] ; then \
39+ Option="$$Option -SD $(NOISE_SD)"; \
40+ fi; \
41+ if [ ! -z "$(NOISE_NS)" ] ; then \
42+ Option="$$Option -NS $(NOISE_NS)"; \
43+ fi; \
44+ if [ ! -z "$(NOISE_SN)" ] ; then \
45+ Option="$$Option -SN $(NOISE_SN)"; \
46+ fi; \
47+ if [ ! -z "$(NOISE_H_TRES)" ] ; then \
48+ Option="$$Option -H $(NOISE_HTRES)"; \
49+ fi; \
50+ if [ ! -z "$(NOISE_L_TRES)" ] ; then \
51+ Option="$$Option -L $(NOISE_LTRES)"; \
52+ fi; \
53+ mrcImageNoiseAdd -i "$(NOISE_IN_FILE_NAME)"."$$inext" -o "$$outfile"."$$outext" $$Option
54+
55+help_NoiseAdd::
56+ @echo
57+ @echo "NoiseAdd"
58+ @echo "This is Sub Makefile to add noise to an image."
59+ @echo
60+ @echo " (Command):"
61+ @echo " NoiseAdd: Add Noise to input file. (if input name = output name, input is renamed.)"
62+ @echo
63+ @echo " (Setting Data):"
64+ @echo " NOISE_IN_FILE_NAME: Inout file name."
65+ @echo " IN_NOISE: Input extention."
66+ @echo " (Option)"
67+ @echo " NOISE_OUT_FILE_NAME: Outout file name. (if empty, it is same as input.)"
68+ @echo " OUT_NOISE: Output extention. (if empty, it is same as input.)"
69+ @echo " NOISE_SD: standard deviation of noise."
70+ @echo " NOISE_NS: NS ratio"
71+ @echo " NOISE_SN: SN ratio"
72+ @echo " NOISE_H_TRES: High threshold to adding noise."
73+ @echo " NOISE_L_TRES: Low threshold to adding noise."
74+ @echo
75+
76+##### Commands(Input to Output) #####
77+
--- a/TIPS/Template/Makefile/Makefile
+++ b/TIPS/Template/Makefile/Makefile
@@ -1,6 +1,8 @@
11 #
22 # This is Main Makefile for !!Command!!.
33 #
4+# Created by template !!Version!!
5+#
46
57 #### Root Makefile ####
68 MAKE_ROOT=!!Command!!
--- a/TIPS/Template/Makefile/Makefile-lib
+++ b/TIPS/Template/Makefile/Makefile-lib
@@ -1,6 +1,8 @@
11 #
22 # This is Sub Makefile for !!Command!!.
33 #
4+# Created by template !!Version!!
5+#
46
57 #### Input extention ####
68 # Defined at Main
Show on old repository browser