Changes between Version 2 and Version 3 of Spatial_Query_Framework

01/10/07 14:05:20 (12 years ago)



  • Spatial_Query_Framework

    v2 v3  
     1This is an overview that I wrote as a paper to help focus on paper writing.  The description doesn't completely match with what was/will be implemented. 
     3Framework of Spatial Query Services 
     5I. Introduction 
     6Labs are generating more and more volumetric neuroimaging data and want to pose increasingly complex queries on this information.  To help accommodate this, we have developed 3 web accessible services for querying this data based on spatial characteristics.  This framework consists of 1) a transformation service to convert data-points between anatomical spaces (i.e. magnet coordinates to normalized space), 2) an atlas server that can answer questions about individual points or export atlas surfaces for further processing and 3) a spatial query service that gives researchers the ability to pose complex spatial queries on their own data.  These services are designed so that they can be integrated and used in many complex and novel ways by using the XQuery query language as the primary integrator. 
     7        While the system would be faster as a monolithic query services running locally, the flexibility offered by using the service based approach outweighs the wasted seconds.  Most of the lost efficiency is due to network speeds and the overhead of packing and unpacking the data at both ends.  While this is a slight concern, the extensibility and pliability offered by this framework allow researchers to quickly design and perform custom spatial queries.  Furthermore, by making the primary integrator a query language, custom queries become much easier to write and tweak. 
     9II. Methods 
     11A. Transformation Service 
     12The transformation service provides a central and interoperable way to warp coordinates and volumes from one set of spatial coordinates to another.  It is extensible and can have many different types of transforms, but currently it supports linear and SPM's non-linear warps. 
     14B. Volumetric Atlas Service 
     15The volumetr 
     16C. Spatial Query Service 
     17The spatial query service allows scientists to query 3D and 4D volumetric imaging data.  The system exposes the following methods for querying the data: 
     18        a.      files(url) 
     19        b.      query-stats(server-url, file-list) 
     20        c.      query-area(server-url, file-list, region) 
     21        d.      query-pnuts(server-url, file-list, region, script) 
     23The server maintains a set of known files and metadata on them, which can be retrieved using method (a).  This list can be supplied at startup or if the central list of files is maintained elsewhere, this list will be populated dynamically.  In addition to providing a useful directory, the file list gives the server a welcome performance boost.  By maintaining a directory of known files, the server only needs to examine available meta data the first time the data-set is seen or if it changes.  At that time, we attempt to figure out: the coordinate system of the volume, the duration if it is a time series and the modality.  After parsing the metadata, the image is also examined to compute global statistics.  These global statistics are exposed through the query-stats method (b).  This method can provide quick access to potentially useful measurements such as average intensity, standard deviation, the maximum and minimum and the bounding box of the volume.   
     25For finer grained statistics, the query-area (c) method can be used.  This technique computes the same statistics as (b) on the fly for a focused region of interest.  The region is specified either by using a simple XML description, an image volume of weights or a url that specifies an image volume.  The XML file can specify several simple shapes concisely (figure C1), but in order to specify less regular shapes, a volume must be used.  The principal reason to support these complex shapes is to allow researchers to use areas exported by the atlas server described above. 
     27|| Point at (0, 0, 0, 0):  || <Point x='0' y='0' z='0' t='0'/> || 
     28|| Sphere with radius 1 at any time: || <Sphere x='0' y='0' z='0' t='*' radius='1'> </Sphere> || 
     29|| Box with a Gaussian || <Box x='-1, 1' y='-1, 1' z='-1, 1' t='*'><Gausian stddev='1'/></Box> || 
     31Fig C1. Example syntax for specifying a simple region. 
     33The final and most powerful query method is query-pnuts, which can process a script written in P-nuts.  P-nuts is a simple and concise scripting language for the Java Virtual Machine.  It has the advantage of integrating cleanly with the underlying system and yet providing a simpler syntax than Java.  The system then provides easy access to the data in the filter region and global statistics.  The results are then automatically formatted as XML and returned. D. Integrator 
     36import module SpatialServices as namespace spatial 
     37let $threshold := 3.2 
     38let $files := spatial:files('http://myserver/files')[space="MNI"] 
     39let $area := spatial:area('Temporal Lobe') 
     40return spatial:query_area('http://myserver/spatial'), $files, 
     41     $area)[max > $threshold] 
     43Fig D1. A simple query to return files with activation in the temporal lobe 
     45III. Discussion