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

From Slicer Wiki
Jump to: navigation, search
m (Text replacement - "slicerWiki/index.php" to "wiki")
 
(34 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Infobox
+
<noinclude>{{documentation/versioncheck}}</noinclude>
|name        = 3D Slicer {{documentation/version}}
+
= Use of get_web_data and for_external_table =
|above        = 3D Slicer
 
|abovestyle  =  
 
  
|image        = [[File:Logo-3DSlicer.png|200px|alt=3D Slicer {{documentation/version}}]]
+
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:
|imagestyle  =
 
|headerstyle  = background:#E7DCC3;
 
|labelstyle  =
 
|datastyle    =
 
  
|header1 = Description
+
{{ambox
|label1  =
+
| type      = content
|data1  =
+
| text      = There are two extra empty lines !
|header2 =
 
|label2  =
 
|data2  = Research platform for the analysis and visualization of medical images, including image guided therapy.
 
|header3 =
 
|label3  =
 
|data3  = Free and extensible open source package.
 
|header4 =
 
|label4  = Multi-platform
 
|data4  = Linux, MacOSX, Windows
 
|header5 =
 
|label5  = Version
 
|data5  = {{documentation/version}}
 
|header6 =
 
|label6  = License
 
|data6  = [http://www.slicer.org/pages/LicenseText Contribution and Software License Agreement]
 
 
}}
 
}}
  
{{#get_web_data:url=http://www.slicer.org/slicerWiki/index.php/Special:GetData/Documentation/4.0/Modules|format=CSV with header|data=name=ModuleName,url=XMLDescriptionUrl}}
+
<pre>
  
{| class="wikitable"
 
! ModuleName
 
! XMLDescriptionUrl {{#for_external_table:<nowiki/>
 
{{!}}-
 
{{!}} [[{{{url}}}]]
 
{{!}} {{{name}}} }}
 
|}
 
  
This is some text
+
Name,Color,Shape
 +
Apple,Red,Round
 +
Banana,Yellow,Oblong
 +
Orange,Orange,Round
 +
Pear,Yellow,"Pear-shaped"
 +
</pre>
  
{{#get_web_data:url=http://discoursedb.org/wiki/Special:GetData/Fruits_data|format=CSV with header|data=name=Name,color=Color,shape=Shape}}
+
{{ambox
{| class="wikitable"
+
| type      = speedy
! Name
+
| text      = The following table should contains Fruits
! Color
+
}}
! Shape {{#for_external_table:<nowiki/>
 
{{!}}-
 
{{!}} [[{{{name}}}]]
 
{{!}} {{{color}}}
 
{{!}} {{{shape}}} }}
 
|}
 
  
{{#get_web_data:url=http://discoursedb.org/wiki/Special:GetData/Fruits_data|format=CSV with header|data=name=Name,color=Color,shape=Shape}}
+
<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"
 
{| class="wikitable"
 
! Name
 
! Name
Line 61: Line 33:
 
{{!}} {{{color}}} }}
 
{{!}} {{{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>
 +
 +
{{#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}}
 +
 +
 +
== Using filter as URL parameter ==
 +
<pre>
 +
{{#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}}
 +
</pre>
 +
 +
{{#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}}
 +
 +
 +
== 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 =
 +
 +
[[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