Difference between revisions of "Documentation/4.0/Developers/Sandbox"

From Slicer Wiki
Jump to: navigation, search
m (Text replacement - "slicerWiki/index.php" to "wiki")
 
(51 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Infobox
+
<noinclude>{{documentation/versioncheck}}</noinclude>
|title        = {{collaborator|url|spl}} Infobox
+
= Use of get_web_data and for_external_table =
|image        = [[{{collaborator|logo|spl}}|200px]]
+
 
|header1 = Main Heading
+
The raw set of data retrieved using this [http://wiki.slicer.org/wiki/Special:GetData/Documentation/4.0/Developers/Sandbox_data URL] is reported below:
|header2 = First set of data
+
 
|label2  = Label
+
{{ambox
|data2  = Data
+
| type      = content
|header3 = Remove this line (optional)
+
| text      = There are two extra empty lines !
|label3  = More Label
+
}}
|data3  = More data
+
 
 +
<pre>
 +
 
 +
 
 +
Name,Color,Shape
 +
Apple,Red,Round
 +
Banana,Yellow,Oblong
 +
Orange,Orange,Round
 +
Pear,Yellow,"Pear-shaped"
 +
</pre>
 +
 
 +
{{ambox
 +
| type      = speedy
 +
| text      = The following table should contains Fruits
 +
}}
 +
 
 +
<pre>
 +
{{#get_web_data:url=http://wiki.slicer.org/wiki/Special:GetData/Documentation/4.0/Developers/Sandbox_data|format=CSV with header|data=name=Name,color=Color,shape=Shape}}
 +
{| class="wikitable"
 +
! Name
 +
! Color {{#for_external_table:<nowiki/>
 +
{{!}}-
 +
{{!}} [[{{{name}}}]]
 +
{{!}} {{{color}}} }}
 +
|}
 +
</pre>
 +
 
 +
= Use of get_web_data and external_value =
 +
 
 +
 
 +
== Using filter as template parameter ==
 +
<pre>
 +
{{#get_web_data:
 +
url=http://wiki.slicer.org/wiki/Special:GetData/Documentation/4.0/Developers/Sandbox_data
 +
|format=CSV with header
 +
|data=bananashape0=Shape
 +
|filters=Name=Banana
 
}}
 
}}
 +
* {{#external_value:bananashape0}}
 +
</pre>
  
{{Infobox
+
{{#get_web_data:
|name        = 3D Slicer
+
url=http://wiki.slicer.org/wiki/Special:GetData/Documentation/4.0/Developers/Sandbox_data
|title        = 3D Slicer
+
|format=CSV with header
 +
|data=bananashape0=Shape
 +
|filters=Name=Banana
 +
}}
 +
* {{#external_value:bananashape0}}
  
|image        = [[File:Logo-3DSlicer.png|200px|alt=3D Slicer]]
 
|imagestyle  =
 
|caption      = Caption for Logo-3DSlicer.png
 
|captionstyle =
 
|headerstyle  = background:#ccf;
 
|labelstyle  = background:#ddf;
 
|datastyle    =
 
  
|header1 = Header defined alone
+
== Using filter as URL parameter ==
|label1  =  
+
<pre>
|data1  =  
+
{{#get_web_data:
|header2 =  
+
url=http://wiki.slicer.org/wiki/Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name=Banana
|label2  = Label defined alone does not display (needs data, or is suppressed)
+
|format=CSV with header
|data2  =
+
|data=bananashape1=Shape
|header3 =
+
}}
|label3  =  
+
* {{#external_value:bananashape1}}
|data3  = Data defined alone
+
</pre>
|header4 = All three defined (header, label, data, all with same number)
 
|label4  = does not display (same number as a header)
 
|data4  = does not display (same number as a header)
 
|header5 =
 
|label5  = Label and data defined (label)
 
|data5  = Label and data defined (data)
 
  
|belowstyle = background:#ddf;
+
{{#get_web_data:
|below = Below text
+
url=http://wiki.slicer.org/wiki/Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name=Banana
 +
|format=CSV with header
 +
|data=bananashape1=Shape
 
}}
 
}}
 +
* {{#external_value:bananashape1}}
 +
 +
 +
== Using fullurl ==
 +
 +
<pre>
 +
{{#get_web_data:
 +
url={{fullurl:Special:GetData/Documentation/4.0/Developers/Sandbox_data}}
 +
|format=CSV with header
 +
|data=bananashape2=Shape
 +
|filters=Name=Banana
 +
}}
 +
* {{#external_value:bananashape2}}
 +
</pre>
 +
 +
{{fullurl:Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name=Banana}}
 +
 +
{{#get_web_data:
 +
url={{fullurl:Special:GetData/Documentation/4.0/Developers/Sandbox_data}}
 +
|format=CSV with header
 +
|data=bananashape2=Shape
 +
|filters=Name=Banana
 +
}}
 +
* {{#external_value:bananashape2}}
 +
 +
= Debug module-footer template =
  
This is some text
+
[[Category:Documentation/{{documentation/version}}/Modules|DicomToNrrdConverter]]
 +
{{#if: {{documentation/{{documentation/version}}/module-category}} | <!-- The following category will be 'MainCategory' assuming category parameter was 'MainCategory.SubCategory'-->
 +
[[Category:Documentation/{{documentation/version}}/Modules/{{Strloc_prefix|{{documentation/{{documentation/version}}/module-category}}|strloc= {{strfind_short|{{documentation/{{documentation/version}}/module-category}}|.|1|lenstr={{strlen_quick|{{documentation/{{documentation/version}}/module-category}}}}|}}-1}}|DicomToNrrdConverter]]
 +
[[Category:Documentation/{{documentation/version}}/Modules/{{documentation/{{documentation/version}}/module-category}}|DicomToNrrdConverter]]
 +
| }}

Latest revision as of 17:02, 21 November 2019

Home < Documentation < 4.0 < Developers < Sandbox


For the latest Slicer documentation, visit the read-the-docs.


Use of get_web_data and for_external_table

The raw set of data retrieved using this URL is reported below:



Name,Color,Shape
Apple,Red,Round
Banana,Yellow,Oblong
Orange,Orange,Round
Pear,Yellow,"Pear-shaped"
{{#get_web_data:url=http://wiki.slicer.org/wiki/Special:GetData/Documentation/4.0/Developers/Sandbox_data|format=CSV with header|data=name=Name,color=Color,shape=Shape}}
{| class="wikitable"
! Name
! Color {{#for_external_table:<nowiki/>
{{!}}-
{{!}} [[{{{name}}}]]
{{!}} {{{color}}} }}
|}

Use of get_web_data and external_value

Using filter as template parameter

{{#get_web_data:
url=http://wiki.slicer.org/wiki/Special:GetData/Documentation/4.0/Developers/Sandbox_data
|format=CSV with header
|data=bananashape0=Shape
|filters=Name=Banana
}}
* {{#external_value:bananashape0}}


  • Error: no local variable "bananashape0" was set.


Using filter as URL parameter

{{#get_web_data:
url=http://wiki.slicer.org/wiki/Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name=Banana
|format=CSV with header
|data=bananashape1=Shape
}}
* {{#external_value:bananashape1}}


  • Error: no local variable "bananashape1" was set.


Using fullurl

{{#get_web_data:
url={{fullurl:Special:GetData/Documentation/4.0/Developers/Sandbox_data}}
|format=CSV with header
|data=bananashape2=Shape
|filters=Name=Banana
}}
* {{#external_value:bananashape2}}

https://www.slicer.org/wiki/Special:GetData/Documentation/4.0/Developers/Sandbox_data,Name%3DBanana


  • Oblong

Debug module-footer template