• R/O
  • HTTP
  • SSH
  • HTTPS

tutorial: Commit

This repository is for tutorials of Eos.


Commit MetaInfo

Revision9d88085adeddae4b2fc3097b35a39a20b64da973 (tree)
Time2014-12-05 14:03:08
Authorkinoshita-eos <kinoshita@yasu...>
Commiterkinoshita-eos

Log Message

Add: tutorial for mrcImageLowPassFilter as PIONE-WebClient.
new file: SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/Annotation.pione
new file: SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/Interaction.pione
new file: SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/LowPassFilter(Kinoshita)+v0.1.1.ppg
new file: SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/Main.pione
new file: SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/bin/EosCommandSelect.cgi
new file: SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/bin/Result-mrcImageLowPassFilter.cgi
new file: SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/bin/Set-mrcImageLowPassFilter.cgi
new file: SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/etc/index.html
new file: SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/pione-package.json

Change Summary

Incremental Difference

--- /dev/null
+++ b/SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/Annotation.pione
@@ -0,0 +1,3 @@
1+.@ PackageName :: "LowPassFilter"
2+.@ Editor :: "Kinoshita"
3+.@ Tag :: "v0.1.1"
--- /dev/null
+++ b/SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/Interaction.pione
@@ -0,0 +1,13 @@
1+Rule Interaction
2+ output '*.*'.all
3+Action
4+ # build public directory for pione-interactive
5+ mkdir public
6+ cp etc/* public
7+ cp bin/* public
8+
9+ # start interactive operation
10+ pione-interactive browser --public public
11+
12+ cp public/* .
13+End
Binary files /dev/null and b/SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/LowPassFilter(Kinoshita)+v0.1.1.ppg differ
--- /dev/null
+++ b/SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/Main.pione
@@ -0,0 +1,5 @@
1+Rule Main
2+ output '*.*'.all
3+Flow
4+ rule Interaction
5+End
--- /dev/null
+++ b/SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/bin/EosCommandSelect.cgi
@@ -0,0 +1,27 @@
1+#!/usr/bin/env ruby
2+
3+require 'cgi'
4+
5+cgi = CGI.new
6+HTMLstr=""
7+
8+
9+# Main Process
10+
11+## Query to Parameters
12+EosCommand=cgi['EosCommand']
13+
14+## Jump Page of Set-[EosCommand].cgi
15+iJumpCount=0
16+
17+HTMLstr += '<meta http-equiv="refresh" content="'
18+HTMLstr += iJumpCount.to_s
19+HTMLstr += ';URL=Set-'
20+HTMLstr += EosCommand
21+HTMLstr += '.cgi">'
22+
23+
24+# Output as html
25+cgi.out(type: "text/html") do
26+ HTMLstr
27+end
--- /dev/null
+++ b/SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/bin/Result-mrcImageLowPassFilter.cgi
@@ -0,0 +1,143 @@
1+#!/usr/bin/env ruby
2+
3+require 'cgi'
4+
5+cgi = CGI.new
6+HTMLstr = ""
7+
8+## Query to Parameters
9+
10+### Copy InputFile
11+fpQueryInputFile = cgi.params['InputFile'][0]
12+strInputFile = fpQueryInputFile.original_filename
13+fpInputFile = open(strInputFile, "wb")
14+fpInputFile.write(fpQueryInputFile.read)
15+fpInputFile.close
16+
17+### Other Query
18+strOutputFile = cgi['OutputFile']
19+strHalfValuePoint = cgi['HalfValuePoint']
20+strWidth = cgi['Width']
21+strMode = cgi['Mode']
22+
23+## Header
24+HTMLstr += "<!DOCTYPE html>"
25+HTMLstr += "<html>"
26+HTMLstr += "<head>"
27+HTMLstr += '<meta charset="utf-8">'
28+HTMLstr += "<title>mrcImageLowPassFilter</title>"
29+HTMLstr += "</head>"
30+
31+HTMLstr += "<body>"
32+
33+### Close or Back
34+HTMLstr += '<a href="?pione-action=finish">Close</a>'
35+HTMLstr += "<br>"
36+HTMLstr += '<form action="Set-mrcImageLowPassFilter.cgi" method="post" enctype="multipart/form-data">'
37+HTMLstr += '<button type="submit">Back</button>'
38+HTMLstr += '<input type="hidden" name="OutputFile" value="' + strOutputFile + '">'
39+HTMLstr += '<input type="hidden" name="HalfValuePoint" value="' + strHalfValuePoint + '">'
40+HTMLstr += '<input type="hidden" name="Width" value="' + strWidth + '">'
41+HTMLstr += '<input type="hidden" name="Mode" value="' + strMode + '">'
42+HTMLstr += '</form>'
43+HTMLstr += "<br>"
44+HTMLstr += "<br>"
45+
46+
47+# Main Process
48+
49+## mrcImageLowPassFilter
50+command = "mrcImageLowPassFilter"
51+command += ' -i "' + strInputFile + '"'
52+command += ' -o "' + strOutputFile + '"'
53+command += ' -hvp "' + strHalfValuePoint + '"'
54+command += ' -w "' + strWidth + '"'
55+command += ' -m "' + strMode + '"'
56+system(command)
57+
58+### mrc2gif
59+#### For input
60+strGifInputFile = strInputFile + ".gif"
61+command = "mrc2gif"
62+command += ' -i "' + strInputFile + '"'
63+command += ' -o "' + strGifInputFile + '"'
64+system(command)
65+
66+#### For output
67+strGifOutputFile = strOutputFile + ".gif"
68+command = "mrc2gif"
69+command += ' -i "' + strOutputFile + '"'
70+command += ' -o "' + strGifOutputFile + '"'
71+system(command)
72+
73+### mrcImageInfo
74+#### For input
75+strInfoInputFile = strInputFile + ".info"
76+command = "mrcImageInfo"
77+command += ' -I'
78+command += ' -i "' + strInputFile + '"'
79+command += ' -o "' + strInfoInputFile + '"'
80+system(command)
81+
82+#### For output
83+strInfoOutputFile = strOutputFile + ".info"
84+command = "mrcImageInfo"
85+command += ' -I'
86+command += ' -i "' + strOutputFile + '"'
87+command += ' -o "' + strInfoOutputFile + '"'
88+system(command)
89+
90+
91+## View as HTML Statement
92+
93+### Table
94+HTMLstr += "<table>"
95+
96+#### Title
97+HTMLstr += "<tr>"
98+HTMLstr += "<td>" + strInputFile + "</td>"
99+HTMLstr += "<td>" + strOutputFile + "</td>"
100+HTMLstr += "</tr>"
101+
102+#### GifImage
103+##### For Input
104+HTMLstr += "<tr>"
105+HTMLstr += "<td>"
106+HTMLstr += '<img src="' + strGifInputFile + '">'
107+HTMLstr += "</td>"
108+##### For Output
109+HTMLstr += "<td>"
110+HTMLstr += '<img src="' + strGifOutputFile + '">'
111+HTMLstr += "</td>"
112+HTMLstr += "</tr>"
113+
114+#### mrcImageInfo
115+##### For Input
116+HTMLstr += "<tr>"
117+HTMLstr += "<td>"
118+fpInfoInputFile = open(strInfoInputFile, "r")
119+fpInfoInputFile.each do |line|
120+ HTMLstr += line + "<br>"
121+end
122+fpInfoInputFile.close
123+HTMLstr += "</td>"
124+##### For Output
125+HTMLstr += "<td>"
126+fpInfoOutputFile = open(strInfoOutputFile, "r")
127+fpInfoOutputFile.each do |line|
128+ HTMLstr += line + "<br>"
129+end
130+fpInfoOutputFile.close
131+HTMLstr += "</td>"
132+HTMLstr += "</tr>"
133+
134+HTMLstr += "</table>"
135+
136+
137+HTMLstr += "</body>"
138+HTMLstr += "</html>"
139+
140+# Output as html
141+cgi.out(type: "text/html") do
142+ HTMLstr
143+end
--- /dev/null
+++ b/SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/bin/Set-mrcImageLowPassFilter.cgi
@@ -0,0 +1,150 @@
1+#!/usr/bin/env ruby
2+
3+require 'cgi'
4+
5+cgi = CGI.new
6+HTMLstr = ""
7+
8+
9+# Main Process
10+
11+## Query to Parameters
12+
13+### Copy InputFile
14+#fpQueryInputFile = cgi.params['InputFile'][0]
15+#strInputFile = fpQueryInputFile.original_filename
16+#fpInputFile = open(strInputFile, "wb")
17+#fpInputFile.write(fpQueryInputFile.read)
18+#fpInputFile.close
19+
20+### Other Query
21+### OutputFile(-o)
22+strOutputFile = cgi['OutputFile']
23+if strOutputFile == "" then
24+ strOutputFile = "outdata.lpf"
25+end
26+
27+### HalfValuePoint(-hvp)
28+strHalfValuePoint = cgi['HalfValuePoint']
29+if strHalfValuePoint == "" then
30+ strHalfValuePoint = "1.0"
31+end
32+
33+### Width(-w)
34+strWidth = cgi['Width']
35+if strWidth == "" then
36+ strWidth = "1.0"
37+end
38+
39+### Mode(-m)
40+strMode = cgi['Mode']
41+if strMode == "" then
42+ strMode = "1"
43+end
44+
45+## HTML Statement Begin
46+HTMLstr += <<'Block-HTML'
47+<!DOCTYPE html>
48+<html>
49+ <head>
50+ <meta charset="utf-8">
51+ <title>mrcImageLowPassFilter</title>
52+ </head>
53+ <body>
54+ <form action="Result-mrcImageLowPassFilter.cgi" method="post" enctype="multipart/form-data">
55+ <button type="submit">開始</button>
56+ <br>
57+ <table>
58+ <tr>
59+ <td>
60+ <input type="file" name="InputFile"/>
61+ </td>
62+ <td>
63+ 入力ファイル名(-i)
64+ </td>
65+ </tr>
66+ <tr>
67+ <td>
68+ <input type="text" name="OutputFile" value="
69+Block-HTML
70+## HTML Statement End
71+
72+HTMLstr += strOutputFile
73+
74+## HTML Statement Begin
75+HTMLstr += <<'Block-HTML'
76+"/>
77+ </td>
78+ <td>
79+ 出力ファイル名(-o)
80+ </td>
81+ </tr>
82+ <tr>
83+ <td>
84+ <input type="text" name="HalfValuePoint" value="
85+Block-HTML
86+## HTML Statement End
87+
88+HTMLstr += strHalfValuePoint
89+
90+## HTML Statement Begin
91+HTMLstr += <<'Block-HTML'
92+"/>
93+ </td>
94+ <td>
95+ HalfValuePoint[A-1] (強度を半分に落とす空間周波数を示す)(-hvp)
96+ </td>
97+ </tr>
98+ <tr>
99+ <td>
100+ <input type="text" name="Width" value="
101+Block-HTML
102+## HTML Statement End
103+
104+HTMLstr += strWidth
105+
106+## HTML Statement Begin
107+HTMLstr += <<'Block-HTML'
108+"/>
109+ </td>
110+ <td>
111+ 空間周波数のcos関数の幅を設定(-w)
112+ </td>
113+ </tr>
114+ <tr>
115+ <td>
116+ <select name="Mode" value="
117+Block-HTML
118+## HTML Statement End
119+
120+HTMLstr += strMode
121+
122+## HTML Statement Begin
123+HTMLstr += <<'Block-HTML'
124+"/>
125+ <option value="1">1: ステップフィルタ</option>
126+ <option value="2">2: cosフィルタ</option>
127+ <option value="3">3: expフィルタ</option>
128+ <option value="4">4: ガウシアンフィルタ</option>
129+ <option value="5">5: ローレンツ型フィルタ</option>
130+ </select>
131+ </td>
132+ <td>
133+ モード(-m)
134+ </td>
135+ </tr>
136+ </table>
137+ </form>
138+ <br>
139+ <br>
140+ <a href="?pione-action=finish">終了</a>
141+ </body>
142+</html>
143+Block-HTML
144+## HTML Statement End
145+
146+
147+# Output as html
148+cgi.out(type: "text/html") do
149+ HTMLstr
150+end
--- /dev/null
+++ b/SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/etc/index.html
@@ -0,0 +1,19 @@
1+<!DOCTYPE html>
2+<html>
3+ <head>
4+ <meta charset="utf-8">
5+ <title>InteractiveCommand Index Page</title>
6+ </head>
7+ <body>
8+ <form action="EosCommandSelect.cgi" method="post" enctype="multipart/form-data">
9+ コマンド選択
10+ <select name="EosCommand">
11+ <option value="mrcImageLowPassFilter">mrcImageLowPassFilter</option>
12+ </select>
13+ <button type="submit">実行画面へ</button>
14+ </form>
15+ <br>
16+ <br>
17+ <a href="?pione-action=finish">終了</a>
18+ </body>
19+</html>
\ No newline at end of file
--- /dev/null
+++ b/SmallTools/mrcImage/mrcImageLowPassFilter/PIONE-WebClient/pione-package.json
@@ -0,0 +1,26 @@
1+{
2+ "PackageName": "LowPassFilter",
3+ "Editor": "Kinoshita",
4+ "Tag": "v0.1.1",
5+ "Parents": [
6+
7+ ],
8+ "Documents": [
9+ "Annotation.pione",
10+ "Interaction.pione",
11+ "Main.pione"
12+ ],
13+ "Scenarios": [
14+
15+ ],
16+ "Bins": [
17+ "bin/.DS_Store",
18+ "bin/EosCommandSelect.cgi",
19+ "bin/Result-mrcImageLowPassFilter.cgi",
20+ "bin/Set-mrcImageLowPassFilter.cgi"
21+ ],
22+ "Etcs": [
23+ "etc/.DS_Store",
24+ "etc/index.html"
25+ ]
26+}
\ No newline at end of file
Show on old repository browser