Literature DB >> 35749160

Quantification of Digital Body Maps for Pain: Development and Application of an Algorithm for Generating Pain Frequency Maps.

Abhishek Dixit1, Michael Lee1.   

Abstract

BACKGROUND: Pain is an unpleasant sensation that signals potential or actual bodily injury. The locations of bodily pain can be communicated and recorded by freehand drawing on 2D or 3D (manikin) surface maps. Freehand pain drawings are often part of validated pain questionnaires (eg, the Brief Pain Inventory) and use 2D templates with undemarcated body outlines. The simultaneous analysis of drawings allows the generation of pain frequency maps that are clinically useful for identifying areas of common pain in a disease. The grid-based approach (dividing a template into cells) allows easy generation of pain frequency maps, but the grid's granularity influences data capture accuracy and end-user usability. The grid-free templates circumvent the problem related to grid creation and selection and provide an unbiased basis for drawings that most resemble paper drawings. However, the precise capture of drawn areas poses considerable challenges in producing pain frequency maps. While web-based applications and mobile-based apps for freehand digital drawings are widely available, tools for generating pain frequency maps from grid-free drawings are lacking.
OBJECTIVE: We sought to provide an algorithm that can process any number of freehand drawings on any grid-free 2D body template to generate a pain frequency map. We envisage the use of the algorithm in clinical or research settings to facilitate fine-grain comparisons of human pain anatomy between disease diagnosis or disorders or as an outcome metric to guide monitoring or discovery of treatments.
METHODS: We designed a web-based tool to capture freehand pain drawings using a grid-free 2D body template. Each drawing consisted of overlapping rectangles (Scalable Vector Graphics <rect> elements) created by scribbling in the same area of the body template. An algorithm was developed and implemented in Python to compute the overlap of rectangles and generate a pain frequency map. The utility of the algorithm was demonstrated on drawings obtained from 2 clinical data sets, one of which was a clinical drug trial (ISRCTN68734605). We also used simulated data sets of overlapping rectangles to evaluate the performance of the algorithm.
RESULTS: The algorithm produced nonoverlapping rectangles representing unique locations on the body template. Each rectangle carries an overlap frequency that denotes the number of participants with pain at that location. When transformed into an HTML file, the output is feasibly rendered as a pain frequency map on web browsers. The layout (vertical-horizontal) of the output rectangles can be specified based on the dimensions of the body regions. The output can also be exported to a CSV file for further analysis.
CONCLUSIONS: Although further validation in much larger clinical data sets is required, the algorithm in its current form allows for the generation of pain frequency maps from any number of freehand drawings on any 2D body template. ©Abhishek Dixit, Michael Lee. Originally published in JMIR Formative Research (https://formative.jmir.org), 24.06.2022.

Entities:  

Keywords:  Body Pain Map; SVG; Scalable Vector Graphics; algorithm; heat map; overlap computation; pain drawing; pain frequency map; pain location

Year:  2022        PMID: 35749160      PMCID: PMC9232214          DOI: 10.2196/36687

Source DB:  PubMed          Journal:  JMIR Form Res        ISSN: 2561-326X


Introduction

Background

Pain is an unpleasant sensation signaling potential or actual injury to the body site [1]. The location of pain can be communicated or recorded by drawing onto a body template (eg, Brief Pain Inventory [2]). Pain drawings have been used clinically and in research for decades [3]. Jang et al [4] reported that patients were more confident about communicating the locations of pain to the clinician in the form of a drawing as opposed to a written description, and the clinicians also favored drawings over written descriptions. Digital technology is now commonplace and circumvents problems associated with the processing and storage of pain drawings; hence, pain drawings are now widely acquired as digital images when possible [5]. Numerous web-based applications and mobile apps offer digital pain manikins, both commercial and academic [6]. Most digital pain manikins use 2D templates, which are whole-body coronal or sagittal views of the human body. There is often a choice of gender and body type for 2D or 3D surface templates [7-9]. A typical digital pain manikin consists of a body template and self-explanatory instructions for the patient regarding how to indicate the locations where they experience the most discomfort. The pain frequency map is generated by the simultaneous analysis of all digital pain drawings to compute the locations of pain that participants have in common. To aid visualization, the maps also use color codes to highlight locations on the body in accordance with their frequency of occurrence in the sample being studied. Such maps are clinically useful in identifying where sensations commonly relate to disease anatomy [10,11] and the factors that influence the subjective localization of pathology. These maps are perhaps most important in chronic primary pain syndromes [12], which are defined by the locations of pain in the absence of disease (eg, chronic back pain). The ease with which pain frequency maps are generated critically depends on the nature of the body template used. For body templates where the anatomical locations are already predefined and demarcated [7,13], the pain drawings are swiftly completed, and the data captured are binary, where 1 indicates a selection, and 0 indicates no selection. As a result, the generation of pain frequency maps is relatively straightforward, because only the number of participants who selected each location needs to be deduced [14]. However, such frequency maps may not entirely capture the underlined spatial patterns of pain because of loss of spatial resolution caused due to the pixel (ie, x-y coordinate, representing the smallest possible division for the body template) being preassigned to larger (hence fewer) anatomical regions (eg, the Collaborative Health Outcomes Information Registry [CHOIR] body template has 74 divisions to click [7]). In addition, assumptions must be made about where the anatomical locations of pain are clinically relevant or important. Freehand pain drawings, using body templates with undemarcated or blank body outlines, are unbiased. Some body templates supporting freehand drawings use a grid with a predefined number of cells (eg, GeoPain app with a 3D body template uses a grid of 2026 cells [9] and Manchester Digital Pain Manikin uses a grid of 12,800 cells for its 2D body template [15]). The grid-based templates also allow the easy generation of pain frequency maps because each location (a cell) is binary in nature and is either selected or not selected. However, as body templates come in a variety of shapes and sizes [5], the aspect ratio (ratio of width to height) of the body regions also changes, and it is therefore not possible to standardize a grid (no one-size-fits-all). The optimal grid granularity (resolution) of each body template must be assessed. The granularity of the grid determines the end-user experience and accuracy of the captured data [15]. The grid-free body template, as the name suggests, overcomes the problem of grid creation and selection and provides an assumption-free basis for pain drawings that most resemble paper drawings. The number of clickable locations is of the order of thousands (depending on the pencil size). In addition, the participant may choose to draw repeatedly in the same location, similar to what happens when pen and paper are used. The precise capture of drawn areas, along with no predefined locations (cells), poses considerable challenges in generating pain frequency maps. The drawings on grid-free templates require intricate pixel-level analysis to generate a pain frequency map, and the tools for generating such maps are lacking or not freely available [16-18].

Objectives

In this paper, we describe a novel and unbiased algorithm developed specifically to generate a spatial pain frequency map from freehand pain drawings on a generic 2D whole-body template. We also assessed the performance of the algorithm’s Python script and demonstrated its utility by generating pain frequency maps from pain drawings obtained from 2 clinical data sets.

Methods

Creating the Digital Body Template (Manikin)

An image outline (or template) of the human body is embedded in an HTML page to create a digital body template (manikin) to capture drawings of pain locations. The responsiveness of the body template (ie, the ability to highlight or zoom in or out of a region) requires vectors, which are created using lines, points, and shapes to represent the different regions (demarcations) of the body. Using Scalable Vector Graphics (SVG), an XML-based language, it is possible to display vectors and create a responsive body template. The locations of pain can be recorded on any body template by inserting basic SVG elements such as circles and rectangles. These shapes are inserted by specifying their position and size as the core attributes. For example, the circle requires coordinates (cx, cy) of the center and the radius (r), and the rectangle requires coordinates (x, y) of the top left corner along with width and height. In addition to the core attributes, the SVG elements can also contain style-related attributes (eg, fill, visibility, and opacity) and any number of customized attributes with prefix data- (eg, data-region and data-date-inserted). The circle and rectangle elements can be created in SVG: We used the SVG element to record the location of pain because the intersection of the 2 rectangles is always a rectangle (consistent geometry) that is required for the algorithm to function. We downloaded a sexless human body outline image (TIFF), which is an adaptation of one of the oldest templates from the early works of Sir Henry Head [19]. The image has 4 views of the human body in 2D: coronal (front and back) and sagittal (left and right). The image was modified to demarcate 4 nonoverlapping regions: the front, side head (right), side head (left), and back. For making regions clickable, the body image was vectorized and converted into SVG using the Inkscape Editor (version 1.1) [20]. Vectorization produced 4 vectors (beziergons), where each vector has an associated bounding box, which is the tightest fitting rectangle that encloses all points on the vector (Figure 1).
Figure 1

The body template (manikin) shows 4 regions. The tightest fitted rectangle (bounding box) enclosing each region is shown in black.

In order to facilitate data capture from drawings of bodily pain locations, we first developed Body Pain Map, a tool using Linux-Apache-Perl-MongoDB–based infrastructure. The HTML5 webpage of the tool consists of a 2-column layout where the right column embeds the SVG body template and the left column contains 7 JavaScript-powered control elements (Figure 2), which are (1) size of rectangular pencil tip (