Heatmap Class
The collection of methods in order to generate the heat maps. The final output is always a web D3.JS rendering!
Item Index
Methods
- assure_node_has_properties
- assure_node_has_property
- check_all_images_have_dimension
- check_all_tokens_are_spatial
- clean_caches
- count_entities_by_label
- count_fragments_in_result
- count_images_in_result
- count_tokens_in_result
- format_heat_map_to_d3js
- get_bounding_box_of_fragment
- get_cached_fragment_bounding_box
- get_cached_fragment_bounding_box_for_token
- get_cached_fragment_of_token
- get_cached_image
- get_cached_image_of_fragment
- get_cached_image_of_token
- normalization_on_bounding_box
- normalization_on_bounding_box_centered
- normalization_on_whole_image
- normalize_token_spatials
- process_heatmap_query
- set_cached_fragment_of_token
- set_cached_image
- set_fragment_bounding_box
Properties
Methods
assure_node_has_properties
-
node -
property_names
Check whether the {node} has the properties {property_name}
Parameters:
-
nodeObject -
property_namesArray
Returns:
assure_node_has_property
-
node -
property_name
Check whether the {node} has the property {property_name}
Parameters:
-
nodeObject -
property_nameString
Returns:
check_all_images_have_dimension
-
records
Check whether every image has the width and height property
Parameters:
-
recordsArray
Returns:
check_all_tokens_are_spatial
-
records
Check whether every record has the x, y, width and height property
Parameters:
-
recordsArray
Returns:
clean_caches
()
Reset the object cache
count_entities_by_label
-
records -
label
Counts the number of entities given a Neo4j Label
Parameters:
-
recordsArray -
labelString
Returns:
count_fragments_in_result
-
records
Counts the number of entities given the Neo4j Label 'Fragment'
Parameters:
-
recordsArray
Returns:
count_images_in_result
-
records
Counts the number of entities given the Neo4j Label 'Image'
Parameters:
-
recordsArray
Returns:
count_tokens_in_result
-
records
Counts the number of entities given the Neo4j Label 'Token'
Parameters:
-
recordsArray
Returns:
format_heat_map_to_d3js
-
heat_map
Reformats the heat map to d3js readable data
Parameters:
-
heat_mapObject
Returns:
d3js data
get_bounding_box_of_fragment
-
token
Check the cache for the bounding box of the token
Parameters:
-
tokenObject
Returns:
get_cached_fragment_bounding_box
-
fragment_id
Check the cache for the fragment's bounding box
Parameters:
-
fragment_idNumber
Returns:
get_cached_fragment_bounding_box_for_token
-
token_id
Check the cached fragment's bounding box for the given token
Parameters:
-
token_idNumber
Returns:
get_cached_fragment_of_token
-
token_id
Check the cache for the token's fragment
Parameters:
-
token_idNumber
Returns:
get_cached_image
-
image_id
Check the cache for the image
Parameters:
-
image_idNumber
Returns:
get_cached_image_of_fragment
-
fragment_id
Check the cache for the image of the fragment
Parameters:
-
fragment_idNumber
Returns:
get_cached_image_of_token
-
token_id
Check the cache for the image of the token
Parameters:
-
token_idNumber
Returns:
normalization_on_bounding_box
-
token -
normalization -
target_width -
target_height
The normalization techniques are documented in Readthedocs
Parameters:
-
tokenObject -
normalizationNull -
target_widthNumber -
target_heightNumber
Returns:
normalized coordinates
normalization_on_bounding_box_centered
-
token -
normalization -
target_width -
target_height
The normalization techniques are documented in Readthedocs
Parameters:
-
tokenObject -
normalizationNull -
target_widthNumber -
target_heightNumber
Returns:
normalized coordinates
normalization_on_whole_image
-
token -
normalization -
target_width -
target_height
The normalization techniques are documented in Readthedocs
Parameters:
-
tokenObject -
normalizationNull -
target_widthNumber -
target_heightNumber
Returns:
normalized coordinates
normalize_token_spatials
-
token -
normalization -
target_width -
target_height
Wrapper for the three different normalization techniques
Parameters:
-
tokenObject -
normalizationNumber1,2,3
-
target_widthNumber -
target_heightNumber
Returns:
normalized coordinates
process_heatmap_query
-
query -
normalization -
width -
height -
pixel_size
Entry point for the heat map calculations
Parameters:
-
queryString -
normalizationNumber1,2,3 [1, SUPPORTED_NORMALIZATIONS]
-
widthNumber]0; MAX_SIZE_HEATMAP[
-
heightNumber]0; MAX_SIZE_HEATMAP[
-
pixel_sizeNumber]0; MAX_PIXEL_SIZE[
Returns:
d3js data
set_cached_fragment_of_token
-
token_id -
fragment_id
Set the cache for the token's fragment
Parameters:
-
token_idNumber -
fragment_idNumber
Returns:
set_cached_image
-
token_id -
fragment_id -
image_id -
image
Set the cache for the token's image
Parameters:
-
token_idNumber -
fragment_idNumber -
image_idNumber -
imageObject
Returns:
set_fragment_bounding_box
-
token_id -
fragment_id -
bb
Set the cache for the token's bounding box
Parameters:
-
token_idNumber -
fragment_idNumber -
bbObject
Properties
BOUNDING_BOX_CACHE
Unknown
The bounding box cache for every fragment. key is fragment_id and value is the bounding box
IMAGE_FRAGMENT_CACHE
Unknown
Suits as a in memory cache for the images, fragments and tokens
Motivation: We don't want to query the database twice for a single object.
key for the sub categories (images, fragments and tokens) is the
