Geometric Data¶
The database can be used to store simple geometric structures, which are usually used as regions of interests. This structures must be defined in a concrete coordinates system. There is one main table which stores general information about the structure (roi), and a table for each roi type which stores its concrete data for each subject.
ROIs¶
-
roi_name_exists(name)[source]¶ Check if a ROI with the given name exists
Parameters: name (str) – ROI name Returns: Trueif a ROI with the given name exists in the database,Falseotherwise.
-
get_roi_id(roi_name)[source]¶ Find the id of a ROI
Parameters: roi_name (str) – ROI Name Returns: ROI id in the database
-
get_roi_name(roi_id)[source]¶ Find the name of a ROI
Parameters: roi_id (int) – ROI id Returns: ROI name
-
get_roi_type(name=None, roi_id=None)[source]¶ Get the type of a ROI
Only one of the two arguments is required, roi_id is preferred
Parameters: Returns: ROI type as a string, see
create_roi()for options
-
get_roi_space(name=None, roi_id=None)[source]¶ Retrieve the coordinate systems of a ROI
Only one of the two arguments is required, roi_id is preferred
Parameters: Returns: coordinate system as a string, see
create_roi()for options
Spheres¶
Spheres are saved as a center (x,y,z) and a radius.
-
load_sphere(sphere_id, subject)[source]¶ Loads a sphere for a subject
Parameters: - sphere_id (int) – ROI id
- subject – subject id
Returns: (r,x,y,z)whereris the radius of the sphere and(x,y,z)is its center.
-
get_available_spheres_df(space=None)[source]¶ Get available spheres
Parameters: space (str) – Optional, filter to only rois in a certain space Returns: DataFramewith columns for sphere id, and number of subjects with the ROI defined; indexed by name
-
get_all_spheres(sphere_id)[source]¶ Get a DataFrame of all the subjects spheres with a given id
Parameters: sphere_id (int) – ROI id Returns: pandas.DataFramewith columns for radius, center x, center y and center z; indexed by subject
-
subjects_with_sphere(sphere_id)[source]¶ Get subjects who have a certain sphere defined
Parameters: sphere_id (int) – ROI id Returns: A set of subjects with the sphere defined
Lines¶
Lines are saved as a starting point (xo,yo,zo) and an end point (xf,yf,zf)
-
load_line(line_id, subject)[source]¶ Retrieves a line for a given subject
Parameters: - line_id (int) – ROI id
- subject – subject id
- Returns
(xo,yo,zo,xf,yf,zf)where(xo,yo,zo)is the line origin and(xf,yf,zf)is the end.
-
get_available_lines_df()[source]¶ Get available lines
Returns: DataFramewith columns for line id, and number of subjects with the ROI defined; indexed by name