Showing posts with label sana. Show all posts
Showing posts with label sana. Show all posts

Friday, February 4, 2011

Barcamp session - Information & Communication Technology for Development

We recently had a barcamp session at work and I held a session on information and communication technology for global development.

We discusses a few cases where technology has been applied to real life issues and involves people who normally did not actively participate in technology. The examples are from:
1) Mobile Money Service (M-PESA in Kenya)
2) Ushahidi - Crowdsourcing information for monitoring elections in India, Swine flue data, Egyptian political crisis
3) Digital Green - Participatory videos for improving farmers way of doing agriculture in India
4) Sana - A mobile health platform for remote diagnostics.

The presentation slides are attached below. Most of the things were actually discussed and hence the presentation may not be comprehensive but nevertheless touches on all points of the session.


You can contact me on pratikmandrekar@gmail.com

DISCLAIMER - All opinions are personal and have no relation whatsoever to the company where the session was conducted. The research is all aggregated from different sources and referenced appropriately in the slides.

-- Pratik Mandrekar

Tuesday, July 6, 2010

Physiological Data Visualization

Visualization of time series data is necessary to understand several physiological activities of patients. This data is obtained from patients by mostly non-intrusive procedures. The pulse oximeter ( A device that indirectly measures oxygen saturation in patients blood), the electrocardiogram (Used to record ECG or EKG signals which is a representation of the electrical activity of the heart obtained by placing leads on the skin on different parts of the body) and the EEG (Electroencephalography - for measuring electrical activity of the scalp produced by neurons firing in the brain) are some examples of the same. The Sana team is working in collaboration with Rich Fletcher from the MIT media lab to use wearable sensors to monitor such activity especially with relevance to developing countries.

In order to get the data from such devices into the Media viewer I needed to get the data to a standard format. Now most doctors and clinicians all over the world use different standards and devices which makes it a difficult task to standardize the visualization part. The physionet is one such resource which supports different standards allowing interconversions, and provides a framework for creating standardized data for physiological signals. To start with one, I used the ECG signals from physiobank (The MIT-BIH Arrythmia database) as the basic data source. I added an interfacing mechanism which would extract the data from physionet compatible file/data formats into Comma seperated Values (CSV). The wfdb library provides functions which can be used in C/C++ to perform almost any task with the data. The ECG signals in the MIT-db comprise of a data (.dat), annotations (.at) and header (.hea) files for every recording. The data file is in binary and cannot be read directly. The processing is carried out using the wfdb package through C/C++ or using wfdb-swig and swig wrappers (Check it out if you are interested in building wrappers around your C/C++ code to enable almost complete portability to other programming languages) for Java, perl and several other languages. I mainly used the rdsamp library with parameters as shown to get the MLII lead data for the record 100.

E.g: rdsamp -r 100 -c -H -f 0 -t 10 -v -pd -s MLII

Owing to the uncertainty in formats for the different signals, we decided on using csv file format as standard input to the time series module in the media viewer. The csv file is stored alongwith the other media files that are uploaded during an encounter with the patient. Normally for an Encounter with the patient the record is stored as Observations into OpenMRS. The ComplexOb support in OpenMRS is to enable things like an X-ray image (The images handled by the media viewer) and other media to be stored for any encounter. I have presumed that the physiological data(mapped with time series visualization) would be one such complexObs uploaded during the encounter. This complexObs needs to be a CSV file for the media viewer to understand and plot the time series graph. Converting the different formats to a csv file is something that needs to be handled (Though I have tested it with physionet compatible formats, other standards need to be studied across the world). However once the csv file is present as complexObs associated with the encounter, the media viewer on load fetches that data similar to the images/audio/video and displays it.


The time series visualization module is built of charting components in flex. the data providers are associative arrays populated with data from the csv files. Hovering over the plot gives the x,y coordinates as a tooltip. A grid is displayed by adding annotation elements to the background. The file is selected from the list of thumbnails shown at the top.


In this a form has been added at the bottom of the plot to enable adding label (as title of the plot) and other information to the graph. This data will have to be stored and associated with the csv file.


Comparing two signals side by side vertically is a use case with applications that enable a doctor to compare the patients data from different leads. the media viewer lets one compare two signals horizontally as well as vertically. The signal to be displayed on either segments of the screen can be selected by focussing on either of the two sides and selecting the csv thumbnails. A slider seperating the two lets you change screen spans for either pf the two plots accordingly.


The vertical side by side viewer with form elements for adding label and comments.

This module is a prototype and depending on usability requirements can be modified further. If you have any suggestions concerning the same, feel free to contact me.

Pratik Mandrekar
pratikmandrekar@gmail.com

The side by side viewer

The Media Viewer is developed to enable to view and perform basic editing tasks on the media associated with a patient. The media could be images, audio or video for now and other things like time series data associated with an ECG scan among other things.

An important requirement for the Media Viewer has been to add the side by side image comparison facility. This would enable practitioners to compare two different images or two sections of the same image side by side. This component has been developed in flex, mainly using the DivBox container. The main reason for choosing this was that i could add sliders to separate sections in this divbox and a user could drag the slider to adjust either side of the view. More ever I could extend it to vertical as well as horizontal modes to enable side by side viewing and editing. The Divbox is added through actionscript to the main canvas area depending on the state of the viewer. Below I will illustrate some of the states which are the possible use-cases for the components.


This is the Single View for the Media Viewer. One can select a thumbnail and if its an image it would be displayed along with the basic editing functions (Zoom, Brightness, Sharpness, Contrast) at the bottom. There is a drop down list at the top which enables you to choose the state of the Media Viewer to either single view, horizontal side by side comparison or vertical side by side comparison. You can also make the image fullscreen and download it to your local machine respectively by using the two controls in the top right corner of the viewer. The thumbnail viewer gives a preview of the image for an image and fixed thumbnails for any other format (audio, video, time series data).


In here, the oral cancer patient images are viewed side by side. The slider in middle separating the two images can be moved so that either of them occupy as much space as they want to. You can select either of the two sides by clicking on either side to set the focus on the right or the left image. More over, you can pan the images and use the mousewheel scroll to zoom in and out by just hovering over the image on either side. The other image editing functions will operate on the selected side of the viewer.



In this use case you can select an image and then use the other side to focus on the same image to get a near and far perspective of the problem. As has been shown, the lesion from near can be seen on the right side while the bigger picture appears on the left. This can be done by simply selecting the images for either side and zooming/panning as may be necessary.



For some images a vertical comparison may be necessary and the media viewer supports this view by simply selecting the vertical side by side view from the drop down menu. The slider separating the two images can again be used to adjust the span of either of the images in the viewer. You can change either of the images by first focussing on the image by clicking it and then selecting the one you want from the thumbnails.


Any feedback or suggestions for more features to this are welcome.

Pratik Mandrekar
pratikmandrekar@gmail.com

Monday, May 31, 2010

A Google Summer



I often wondered how software or more specifically the skills I learn as a Computer Science student could be used in a way that would benefit a lot more people than harvesting virtual crops on a social networking site. Then thanks to a friend, I just came across an entire domain that had never really crossed my mind before; it was the field of health care IT or medical informatics or whatever else you may call it, basically using software to provide better treatment to patients, providing diagnostics and making health care accessible to regions which just didn't have the human or economic resources to do so.

I initially explored certain open source tools in the field of medical visualization. For anyone intending to work in that field, I think Slicer is an amazing tool to explore. After exploring the the field interfacing medical devices with computers and the associated media generation from them I learned a couple of things like DICOM which is the medical imaging communication standard, medical ontologies and well Doctors & Clinicians especially Radiologists :)

I had been planning on applying for Google Summer of Code this year and I decided to apply for OpenMRS since they worked in this field of interest to me and had done amazing work in supporting data in holistic medical solutions across the world. One of the open projects for the Summer included working on a Media viewer module for openMRS which would enable health care workers to upload media like X-rays, videos of lesions, photos of scars, audio of heartbeats captured through a stethoscope and a whole lot of other things along with the patient diagnostics which would help doctors visually analyze the case of the patient better.

This particular project was developed by Sana, which is a student organization based at the Massachusetts Institute of Technology (NextLab, Center for Transpotation and Logistics, Engineering Systems Division) that offers an end-to-end system that seamlessly connects health workers to medical professionals. My mentor Katherine Kuan along with RJ Ryan had originally developed the media viewer documented on the blog and I have to add enhancements to the viewer to functionally improve some of the existing features while adding new components to it. Sana basically works by installing a mobile application (Currently on Android phones) which is given to health care workers in rural areas who record encounters with patients as observations through a structured diagnosis process, uploading the data through a dispatch server to OpenMRS backed data management service in most cases. The doctors can then login from any part of the world, analyze the case and treat the patient accordingly thereby enabling access to quality health care to the remotest of places with basic mobile connectivity (Sana's packetization algorithms work really well, even transmitting images and audio as a standard SMS in areas with poor data packet connectivity).

I have just started my work understanding the code base, learning new technology, analyzing use cases and meeting some amazing people all along. Hopefully will get some interesting update for you soon!

Pratik Mandrekar