Changes between Initial Version and Version 1 of TransformationServer


Ignore:
Timestamp:
05/08/06 13:34:25 (12 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TransformationServer

    v1 v1  
     1= TransformationServer = 
     2---- 
     3'''Eider Moore''' 
     4---- 
     5 
     6== Overview == 
     7The Transformation Server is a simple web service that can transform coordinates and sets of coordinates efficiently and be tied in to complex systems of data sources.   
     8 
     9It provides an interface with 3 basic functions: 
     10 * {{{double[] transform(String startSpace, String targetSpace, double[] coord)}}} transforms a set of coordinates from space startSpace to targetSpace.  coord must be divisible by 3 and the results appear in order.  null signals an error. 
     11 * {{{double[] transformXYZ(String startSpace, String targetSpace, double x, double y, double z)}}} transforms a single coordinate from startSpace to targetSpace.  null signals an error. 
     12 * {{{String transformXML(String xml)}}} transforms a set of points in the xml format specified below. 
     13 
     14Currently available spaces 
     15 * Magnet space for many patients, this is specified using the P number.  So the magnet space for P143 is called "P143". 
     16 * MNI is the name for the non-linear normalization generated by matlab. 
     17 
     18=== Goals === 
     19 1. Provide a simple interface for transforming coordinates and eventually volumes. 
     20 1. Make it easily callable from a Web Service enabled XQuery 
     21 
     22== Usage == 
     23The following calls are available: 
     24 * port: TransformationWS 
     25  * call: double[] transform(String, String, double[]) 
     26  * call: double[] transformXYZ(String, String, double, double, double) 
     27  * call: String transformXML(String xml)  
     28 
     29The wsdl lives at: 
     30 * http://femur.biostr.washington.edu:8080/Transformer/wsdl/TransformationWS.wsdl 
     31 * http://sig.biostr.washington.edu/~ebmoore/wsdl/TransformationWS.wsdl (using this link protects you in case it changes servers) 
     32 
     33 
     34## == Bugs/Issues == 
     35 
     36## == Documentation == 
     37## [http://sig.biostr.washington.edu/javadoc javadoc...] 
     38 
     39== Source Home == 
     40[http://sig.biostr.washington.edu/viewcvs/viewcvs.cgi/src/brain/TransformationServer/ CVS] 
     41 
     42## == Compiling == 
     43## ''If the code needs to be compiled, include instructions here'' 
     44 
     45== Configuration == 
     46There is a configuration file that specifies the external interfaces (like Web Service, or RMI) and the Transform Sources. 
     47 
     48[http://sig.biostr.washington.edu/viewcvs/viewcvs.cgi/src/brain/TransformationServer/edu/washington/biostr/sig/transformationserver/config.xml?rev=HEAD&content-type=text/vnd.viewcvs-markup config.xml] 
     49 
     50=== Required Libraries === 
     51 1. matfile (part of MindSeer) 
     52 1. vecmath.jar (part of Java3D) 
     53 
     54## == Downloads == 
     55## [http://sig.biostr.washington.edu/downloads Compiled Version...] 
     56 
     57== Example == 
     58=== XML Format === 
     59The Transformation Server simply acts as a "filter" for xml files.   
     60It expects transformable elements have the form: 
     61{{{<AAA xS="#" yS="#" zS="#" spaceS="xxx" spaceT="yyy".../>}}} 
     62where AAA, S and T are some strings specified in the param element.  The default values are AAA="Coord", S="" and T="p" 
     63 
     64The parameter element looks like: 
     65{{{<TransformServerParam coord=AAA source=S target=T/>}}} 
     66A file can have multiple param elements, but only one is active at a time. 
     67 
     68The resulting elements look like: 
     69{{{<AAA xS="#" yS="#" zS="#" xT="#" yT="#" zT="#" spaceS="xxx" spaceT="yyy".../>}}} 
     70elements that could not be transformed are left unchanged. 
     71 
     72==== Query ==== 
     73{{{ 
     74<?xml version="1.0" encoding="UTF-8"?> 
     75<result> 
     76   <TransformServerParam coord="Site" source="0" target=""/> 
     77   <SiteSet> 
     78      <Site z0="43.2242" y0="15.2846" space0="P40" x0="-61.117" space="MNI"/> 
     79   </SiteSet> 
     80   <SiteSet> 
     81      <Site z0="8.84224" y0="10.0739" space0="P175" x0="-63.0056" space="MNI"/> 
     82      <Site z0="" y0="" space0="P175" x0="" space="MNI"/> 
     83      <Site z0="" y0="" space0="P175" x0="" space="MNI"/> 
     84   </SiteSet> 
     85   <SiteSet> 
     86      <Site z0="-3.41681" y0="5.82331" space0="P176" x0="-55.183" space="MNI"/> 
     87      <Site z0="16.3706" y0="-14.5631" space0="P176" x0="-56.8303" space="MNI"/> 
     88      <Site z0="29.2965" y0="-3.11291" space0="P176" x0="-54.1749" space="MNI"/> 
     89      <Site z0="29.3128" y0="25.4766" space0="P176" x0="-50.93" space="MNI"/> 
     90   </SiteSet> 
     91   <SiteSet> 
     92      <Site z0="54.1727" y0="-22.2383" space0="P180" x0="-61.6022" space="MNI"/> 
     93      <Site z0="39.0166" y0="43.4129" space0="P180" x0="-60.7196" space="MNI"/> 
     94   </SiteSet> 
     95</result> 
     96 
     97}}} 
     98 
     99==== Results ==== 
     100(With comments added) 
     101{{{ 
     102<?xml version="1.0" encoding="UTF-8"?> 
     103<result> 
     104   <SiteSet> 
     105      <!-- No result, this happened because the transform was missing--> 
     106      <Site space="MNI" space0="P40" x0="-61.117" y0="15.2846" z0="43.2242"/> 
     107   </SiteSet> 
     108   <SiteSet> 
     109      <Site space="MNI" space0="P175"  
     110            x="-68.60679111456197" x0="-63.0056"  
     111            y="-32.86716547248121" y0="10.0739"      
     112            z="-13.234578717088032" z0="8.84224"/> 
     113      <!-- No result, we can see that x0, y0 and z0 are not well formed numbers --> 
     114      <Site space="MNI" space0="P175" x0="" y0="" z0=""/> 
     115      <Site space="MNI" space0="P175" x0="" y0="" z0=""/> 
     116   </SiteSet> 
     117   <SiteSet> 
     118      <Site space="MNI" space0="P176"  
     119            x="-67.58274147783507" x0="-55.183"  
     120            y="-22.90874839761436" y0="5.82331"  
     121            z="-14.544820550231218" z0="-3.41681"/> 
     122      <Site space="MNI" space0="P176"  
     123            x="-68.55109629091004" x0="-56.8303"  
     124            y="-39.47003478299405" y0="-14.5631"  
     125            z="13.16206175269939" z0="16.3706"/> 
     126      <Site space="MNI" space0="P176"  
     127            x="-66.40935779142154" x0="-54.1749"  
     128            y="-26.490035940996393" y0="-3.11291"  
     129            z="26.917132021058052" z0="29.2965"/> 
     130      <Site space="MNI" space0="P176"  
     131            x="-63.21571114060569" x0="-50.93"  
     132            y="2.0770550693861893" y0="25.4766"  
     133            z="23.886955954453846" z0="29.3128"/> 
     134   </SiteSet> 
     135   <SiteSet> 
     136      <Site space="MNI" space0="P180"  
     137            x="-64.70538253518367" x0="-61.6022"  
     138            y="-50.57022981543601" y0="-22.2383"  
     139            z="32.82833817873621" z0="54.1727"/> 
     140      <Site space="MNI" space0="P180"  
     141            x="-60.30387157469157" x0="-60.7196"  
     142            y="18.73370849025228" y0="43.4129"  
     143            z="12.731151590421875" z0="39.0166"/> 
     144   </SiteSet>  
     145</result> 
     146}}} 
     147 
     148=== AngloSaxon === 
     149The Transformation Server can be integrated with xquery by using AngloSaxon.  An example follows below. 
     150 
     151Note that while using anglo:xquery is a little confusing for a generic call (the more proper way would be anglo:wscall(...) and then making that result a document with anglo:toDocument()), the documentation for anglo:xquery shows that this is guaranteed the correct result. 
     152 
     153{{{ 
     154declare namespace anglo="java:edu.washington.biostr.sig.anglo.WebServiceWrapper"; 
     155let $result := anglo:xquery( 
     156   "http://femur.biostr.washington.edu:8080/Transformer/wsdl/TransformationWS.wsdl", 
     157   "TransformationWS", "transformXML",  
     158   '<q> 
     159   <TransformServerParam coord="Site" source="0" target=""/> 
     160   <SiteSet> 
     161      <Site z0="-3.41681" y0="5.82331" space0="P176" x0="-55.183" space="MNI"/> 
     162      <Site z0="16.3706" y0="-14.5631" space0="P176" x0="-56.8303" space="MNI"/> 
     163   </SiteSet> 
     164</q>') 
     165return $result 
     166}}}