diff --git a/docs/paper/assets/shuttle.json b/docs/paper/assets/shuttle.json new file mode 100644 index 00000000..e69de29b diff --git a/docs/paper/code/figures.py b/docs/paper/code/figures.py new file mode 100644 index 00000000..850e577c --- /dev/null +++ b/docs/paper/code/figures.py @@ -0,0 +1,13 @@ +"""Generate figures for paper.md +""" + +from shapeflow.config import loads +from shapeflow.video import init + + +if __name__ == '__main__': + # Example figure: SIMPLE-iSIMPLE shuttle + va = init(loads("../assets/shuttle.json")) + + va.analyze() + diff --git a/docs/paper/paper.bib b/docs/paper/paper.bib new file mode 100644 index 00000000..711822ad --- /dev/null +++ b/docs/paper/paper.bib @@ -0,0 +1,103 @@ +@article{Mohammed:2015, +title = "Lab-on-a-chip or Chip-in-a-lab: Challenges of Commercialization Lost in Translation", +journal = "Procedia Technology", +volume = "20", +pages = "54 - 59", +year = "2015", +note = "Proceedings of The 1st International Design Technology Conference, DESTECH2015, Geelong", +issn = "2212-0173", +doi = "https://doi.org/10.1016/j.protcy.2015.07.010", +url = "http://www.sciencedirect.com/science/article/pii/S2212017315001875", +eprint = "http://www.sciencedirect.com/science/article/pii/S2212017315001875", +author = "Mazher Iqbal Mohammed and Steven Haswell and Ian Gibson", +keywords = "lab-on-a-chip, commercialization, microfluidics, translation", +abstract = "Lab-on-a-chip technology has been long envisaged to have tremendous commercial potential, owing to the ability of such devices to encapsulate a full range of laboratory processes in a single instrument and operate in a portable manner, rapidly and at low cost. Devices are believed to have potential in fields ranging across medical diagnostics, environmental sampling and a range of consumer products, however, to date very few devices have attained commercial success. This review examines the challenges relating to the commercialization of lab-on-a-chip technology from fundamental research to mass manufacturing and aims to provide insight to both academics and product development specialists the perceived hindrances to commercialization and a strategy by which future work could be translated into commercial success." +} + +@article{Martinez:2010, +author = "Martinez, Andres W. and Phillips, Scott T. and Whitesides, George M. and Carrilho, Emanuel", +title = "Diagnostics for the Developing World: Microfluidic Paper-Based Analytical Devices", +journal = "Analytical Chemistry", +volume = "82", +number = "1", +pages = "3-10", +year = "2010", +doi = "https://doi.org/10.1021/ac9013989", +note ="PMID: 20000334", +url = "https://doi.org/10.1021/ac9013989", +eprint = "https://doi.org/10.1021/ac9013989" +} + +@article{Eltzov:2015, +author = "Eltzov, Evgeni and Guttel, Sarah and Low Yuen Kei, Adarina and Sinawang, Prima Dewi and Ionescu, Rodica E. and Marks, Robert S.", +title = "Lateral Flow Immunoassays – from Paper Strip to Smartphone Technology", +journal = "Electroanalysis", +volume = "27", +number = "9", +pages = "2116-2130", +keywords = "Lateral flow immunoassays, Paper strip, Smartphone biosensors", +doi = "https://doi.org/10.1002/elan.201500237", +url = "https://onlinelibrary.wiley.com/doi/abs/10.1002/elan.201500237", +eprint = "https://onlinelibrary.wiley.com/doi/pdf/10.1002/elan.201500237", +abstract = "Abstract Lateral flow immunoassays provide low cost, fast, portable and simple to use devices, with yes/no answers seen by the naked eye, that has found applications in agriculture, biomedicine, the environment, and food industries. Making these quantitative, via electrochemical or optical approaches, is the present day challenge, with a vision that one day, these will be connected to smartphone technologies, which exhibit a promising digital platform for point-of-care diagnostics, mobile healthcare and bioanalytical needs. These devices are fully automated and equipped with a high resolution camera, a powerful processor with high storage capacity, wireless connectivity, real-time geo-tagging, secure data management, and cloud computing.", +year = "2015" +} + +@Article{Kokalj:2014, +author = "Kokalj, Tadej and Park, Younggeun and Vencelj, Matjaž and Jenko, Monika and Lee, Luke P.", +title = "Self-powered Imbibing Microfluidic Pump by Liquid Encapsulation: SIMPLE", +journal = "Lab Chip", +year = "2014", +volume = "14", +issue = "22", +pages = "4329-4333", +publisher = "The Royal Society of Chemistry", +doi = "https://doi.org/10.1039/C4LC00920G", +url = "http://dx.doi.org/10.1039/C4LC00920G", +abstract = "Reliable, autonomous, internally self-powered microfluidic pumps are in critical demand for rapid point-of-care (POC) devices, integrated molecular-diagnostic platforms, and drug delivery systems. Here we report on a Self-powered Imbibing Microfluidic Pump by Liquid Encapsulation (SIMPLE), which is disposable, autonomous, easy to use and fabricate, robust, and cost efficient, as a solution for self-powered microfluidic POC devices. The imbibition pump introduces the working liquid which is sucked into a porous material (paper) upon activation. The suction of the working liquid creates a reduced pressure in the analytical channel and induces the sequential sample flow into the microfluidic circuits. It requires no external power or control and can be simply activated by a fingertip press. The flow rate can be programmed by defining the shape of utilized porous material: by using three different paper shapes with circular section angles 20°, 40° and 60°, three different volume flow rates of 0.07 μL s−1, 0.12 μL s−1 and 0.17 μL s−1 are demonstrated at 200 μm × 600 μm channel cross-section. We established the SIMPLE pumping of 17 μL of sample; however, the sample volume can be increased to several hundreds of μL. To demonstrate the design, fabrication, and characterization of SIMPLE, we used a simple, robust and cheap foil-laminating fabrication technique. The SIMPLE can be integrated into hydrophilic or hydrophobic materials-based microfluidic POC devices. Since it is also applicable to large-scale manufacturing processes, we anticipate that a new chapter of a cost effective, disposable, autonomous POC diagnostic chip is addressed with this technical innovation." +} + +@Article{DalDosso:2018, +author="Dal Dosso, Francesco and Kokalj, Tadej and Belotserkovsky, Jaroslav and Spasic, Dragana and Lammertyn, Jeroen", +title="Self-powered infusion microfluidic pump for ex vivo drug delivery", +journal="Biomedical Microdevices", +year="2018", +month="May", +day="31", +volume="20", +number="2", +pages="44", +abstract="In this work, we present a new iSIMPLE concept (infusion Self-powered Imbibing Microfluidic Pump by Liquid Encapsulation), which requires no external power for activation nor liquid manipulation, it is easy to use while its fabrication method is extremely simple, inexpensive and suited for mass replication. The pump consists of a working liquid, which is - after finger activation - absorbed in a porous material (e.g. filter paper). The air expelled from the porous material increases the pressure in the downstream outlet channel and propels the outlet liquid (i.e. the sample) through the channel or ejects it. Here we investigated the influence of different filter papers on the iSIMPLE flow rates, achieving a wide range from 30 down to 0.07 $\mu$L/min. We also demonstrated the versatility of the iSIMPLE in terms of the liquid volume that can be manipulated (from 0.5 $\mu$L up to 150 $\mu$L) and the working pressure reaching 64 kPa, unprecedented high for a self-powered microfluidics pump. In addition, using a 34 G microneedle mounted on the iSIMPLE, we successfully injected liquids with different viscosities (from 0.93 up to 55.88 cP) both into an agarose matrix and a skin-like biological ex vivo substrate (i.e. chicken breast tissue). This work validated the compatibility of the iSIMPLE with drug delivery in a controlled way into a skin-like matrix, envisioning a whole new scenario for intradermal injections using self-contained skin patch. In addition, due to the extreme flexibility of the design and manufacturing, the iSIMPLE concept offers enormous opportunities for completely autonomous, portable and cost effective LOC devices.", +issn="1572-8781", +doi="10.1007/s10544-018-0289-1", +url="https://doi.org/10.1007/s10544-018-0289-1" +} + +@article{DalDosso:2019, +title = "SIMPLE analytical model for smart microfluidic chip design", +journal = "Sensors and Actuators A: Physical", +volume = "287", +pages = "131 - 137", +year = "2019", +issn = "0924-4247", +doi = "https://doi.org/10.1016/j.sna.2019.01.005", +url = "http://www.sciencedirect.com/science/article/pii/S0924424718318910", +author = "Dal Dosso, Francesco and Bondarenko,Yura and Kokalj, Tadej and Lammertyn, Jeroen", +keywords = "Self-powered microfluidics, analytical model, flow-rate design tool, SIMPLE pump", +abstract = "Precise control of the flow dynamics in a microfluidic device is of great importance for the integration of bioassays on-chip. Recently, the Self-powered Imbibing Microfluidic Pump by Liquid Encapsulation (SIMPLE) was developed in our group and integrated with biological applications. The system functions based on capillary imbibition of a working liquid (WL) into a porous material (PM), which in turn pulls a sample liquid (SL) through the connected microfluidic channel network. Analytical models describing the pumping dynamics of paper-based and channel-based systems have been presented, but no suitable analytical models have been reported for hybrid systems such as SIMPLE. Moreover, the available models were mostly limited to only describing the pumping process (i.e. flow rate) for given design parameters (i.e. paper shape, channels geometry), which still resulted in tedious trial-and-error process to optimize the chip design to achieve the desired flow rate. In this work, we developed a smart designing tool for SIMPLE-based chips that provides the design parameters necessary to obtain a targeted flow rate. An analytical model for the SIMPLE was first derived and validated, confirming its 3 main hypotheses: i) the sample flow rate is dependent on the porous material geometry but independent from the ii) porous material volume and iii) channel geometry. All experimental results were in good agreement with this model. Finally, we used our model as a prediction tool providing precise design parameters to avoid the time-consuming trial-and-error approach needed to achieve a specific flow rate. In particular, several chips were fabricated according to the model inputs and the sample liquid flow rates measured (1.5 ± 0.3, 5.3 ± 1.5, 15.2 ± 2.7 μL/min) were matching the targeted ones (1.5, 5, 15 μL/min). The analytical model developed in this work was proven to be a useful designing tool for fast and efficient optimization of SIMPLE-based chips in order to address specific application requirements." +} + +@article{Hu:2014, +title = "Advances in paper-based point-of-care diagnostics", +journal = "Biosensors and Bioelectronics", +volume = "54", +pages = "585 - 597", +year = "2014", +issn = "0956-5663", +doi = "https://doi.org/10.1016/j.bios.2013.10.075", +url = "http://www.sciencedirect.com/science/article/pii/S095656631300777X", +author = "Jie Hu and ShuQi Wang and Lin Wang and Fei Li and Belinda Pingguan-Murphy and Tian Jian Lu and Feng Xu", +keywords = "Microfluidics, Point-of-care (POC), Paper-based diagnostics", +abstract = "Advanced diagnostic technologies, such as polymerase chain reaction (PCR) and enzyme-linked immunosorbent assay (ELISA), have been widely used in well-equipped laboratories. However, they are not affordable or accessible in resource-limited settings due to the lack of basic infrastructure and/or trained operators. Paper-based diagnostic technologies are affordable, user-friendly, rapid, robust, and scalable for manufacturing, thus holding great potential to deliver point-of-care (POC) diagnostics to resource-limited settings. In this review, we present the working principles and reaction mechanism of paper-based diagnostics, including dipstick assays, lateral flow assays (LFAs), and microfluidic paper-based analytical devices (μPADs), as well as the selection of substrates and fabrication methods. Further, we report the advances in improving detection sensitivity, quantification readout, procedure simplification and multi-functionalization of paper-based diagnostics, and discuss the disadvantages of paper-based diagnostics. We envision that miniaturized and integrated paper-based diagnostic devices with the sample-in-answer-out capability will meet the diverse requirements for diagnosis and treatment monitoring at the POC." +} + diff --git a/docs/paper/paper.md b/docs/paper/paper.md new file mode 100644 index 00000000..62c7b74d --- /dev/null +++ b/docs/paper/paper.md @@ -0,0 +1,144 @@ +--- +title: 'shapeflow: A tool for extracting time-series data from video footage of self-powered microfluidic devices' +tags: + - microfluidics + - point-of-care + - self-powered + - Python + - OpenCV +authors: + - name: Bondarenko Yura + orcid: 0000-0003-0872-7098 + affiliation: 2 + - name: Francesco Dal Dosso + orcid: 0000-0003-4546-5154 + affiliation: 1 +affiliations: + - name: Biosensors group, BIOSYST-MeBioS, KU Leuven + index: 1 + - name: Independent Researcher + index: 2 +date: 4 November 2020 +bibliography: paper.bib +--- + +# Statement of need + +During the global COVID-19 pandemic the ever-growing need for easier, faster, more precise and more compact diagnostic testing has been very clear. +Microfluidics is a key technology in enabling the minuaturization and automation required to address this. +As microfluidic devices have gained a foothold in the field, the limitations of this technology at the point-of-care (POC) have also become clear: all too often, the ideal of a “lab-on-a-chip” (LOC) is not feasible for complex bioassays, and in the extreme such a device kan become more akin to a “chip-in-a-lab”. +One of the approaches to mitigate this issue is to replace external, powered propulsion systems (such as syringe pumps) with internal, passive alternatives [@Mohammed:2015]. + +One of the major avenues in self-powered pumping involves leveraging the imbibition of liquids into porous materials such as paper for propulsion. +Such paper-based microfludic devices have been developed for a variety of applications ranging from simple single-step lateral flow assays [@Eltzov:2015] to multi-step and multiplexed assays [@Martinez:2010]. +However, due to sample retention in porous materials, the volumes required for a more complex assay are larger than in a channel-based microfluidic device, which can be problematic in a POC context. +With the (i)SIMPLE platform, we combine the principles of channel-based microfluidics with the self-powered pumping of paper-based microfluidics to separate propulsion and sample handling in different channels, thus providing more flexibility in terms of the assay [@Kokalj:2014] [@DalDosso:2018]. + +Variability of pumping performance is a well-documented fact in paper-based microfluidics [@Hu:2014], and even more so when the paper is encapsulated into a chip. +This concern highlights the need for smart chip design, which we addressed in a past publication [@DalDosso:2019]. +To further facilitate fast prototyping with the (i)SIMPLE platform and support this smart design approach, a fast and convenient way to evaluate an individual chip’s peformance is necessary. +Given the geometrical complexity of (i)SIMPLE chips, peforming video analyses on a case-by-case basis is difficult and tedious. We developed `shapeflow` as a solution to this problem. + +# Overview + +In order to produce our microfluidics with enough repeatability, we make use of computer-aided design (CAD) software to design the channel geometry for each chip. +The final designs are then used to manufacture chips using CNC and laser cutter equipment (WHICH EQUIPMENT). +While different fabrication methods will use different computer-aided manufacturing (CAM) techniques (such as lithography or 3D printing), in any case the design of a microfluidic chip represents its ground-truth geometry. +Furthermore, in order to fabricate chips correctly, the design must match the actual dimensions of the chip it should produce. + +In our image analysis pipeline, we relate the physical chip as recorded in video footage to the actual geometry and dimensions encoded in its design. +We do this by aligning the design to the video footage and estimating a transformation matrix from 'video coordinates' to 'design coordinates'. +Because the original design of the chip often contains information that is not required for this (such as designs for multiple layers or different materials), we use a 'analysis design' based on the original 'fabrication design' for this step. +The 'analysis design' should include a general outline of the chip to aid alignment along with a number of regions of interest (ROI) to divide the chip into clear parts, such as different channels or different parts of a single channel. +Currently, the application handles 'analysis designs' in SVG format, with each region of interest in a separate layer for ease of processing. Detailed instructions on how to set up these 'analysis designs' are provided in the `shapeflow` repository. + +In each ROI, we want to capture one or multiple liquid plugs over the duration of the video. We achieve this by configuring a filter to binarize this plug. +This has to be repeated for all ROIs in the design. +The actual data we extract are feature values computed from the resulting binary images. +A basic example of such a feature is the area of the liquid plug in “real life” units, which we estimate based on the number of pixels in the binary image and the DPI of the design. + +In an analysis, any number of features may be requested, and additional parameters can be configured depending on the type of the feature. +Before starting the analysis, we select a number of frames according to the desired temporal resolution. +We align the ‘analysis design’ to the video footage and configure the filters for each ROI. +At this point we can start the analysis. +For every requested frame in the video, the transformation estimated in the alignment step is first applied to map the frame to 'design coordinates'. +Then, each ROI in the design is masked off individually, its filter is applied and all requested features are computed based on the resulting binary image. +The resulting values are exported as a time-series spreadsheet for futher processing. + + + +# Application + +> * The application is structured as a frontend (user interface) and a backend server which can handle multiple analyses at the same time. +> * Backend +> * REST API (abridged) +> * Analyses are associated with an ID which is used by the API +> * This ID is volatile +> * Video frames are cached, which enables quick re-analysis in case e.g. the user wants to make quick adjustments +> * Plugin system to easily add functionality +> * Transformations +> * Filters +> * Features +> * Analysis configuration and results are stored in a SQLite database +> * Enables undo/redo functionality +> * Enables selective exporting of results for further processing +> * Enables easier meta-analyses which will be useful in e.g. characterizing the repeatablity of our data analysis approach +> * The database also keeps track of video and design files by their hash. This is useful in case files are moved or renamed +> * Configuration is exported alongside the results for posterity +> * Frontend +> * The user can queue up multiple analyses and configure them separately +> * Each analysis can be addressed individually through its configure, align, filter and results pages +> * Preparation is non-linear; the user can skip between different pages in the application in any way they choose +> * The user can start the analysis queue after preparing multiple analyses to let them run sequentially + +# Examples + +> add examples from previous Biosensors publications; compare previous manual / ImageJ results to shapeflow +> +> * [Self-powered Imbibing Microfluidic Pump by Liquid Encapsulation: SIMPLE](https://doi.org/10.1039/C4LC00920G) +> * Figure 3 +> * Ask Tadej whether they can still find some of the design & raw video & data +> * [Self-powered infusion microfluidic pump for ex vivo drug delivery](https://doi.org/10.1007/s10544-018-0289-1) +> * Figure 4 +> * Ask Francesco for the design files & video footage +> * [SIMPLE analytical model for smart microfluidic chip design](https://doi.org/10.1016/j.sna.2019.01.005), maybe? +> * [Innovative Hydrophobic Valve Allows Complex Liquid Manipulations in a Self-Powered Channel-Based Microfluidic Device](https://doi.org/10.1021/acssensors.8b01555) +> * Figure 6 and Figure 7 as examples of more complex designs +> * Already have video & design for Figure 7, ask for Figure 6 as well +> +> graphs: +> +>> * original measurements +>> * a shapeflow measurement, which should match the original more or less +> + +# Further work + +> * This principle is applicable to paper microfluidics in general and could be useful with complex shapes (give some examples) +> * As of now, we don’t have a solid quantitative insight into the expected variability yet (apart from the regular design-chip mismatch, movements, lighting issues and video quantization error, the expected error sources are inconsistencies in manual layout and filter settings) +> * Currently, the application is run locally by each user; this is something that could pose issues when scaling. Some basic stress testing has shown that the application in its current state is able to handle more than a regular user would need it to. The REST backend is already a good start to transition to a cloud-hosted deployment in case this should prove necessary. +> * The deployment mechanism used is not suited for larger teams and may be replaced in the future should this prove necessary. For the current team size and the current maintainers this system is easy to use and support. +> * Support other design file formats and make formatting design files more straightforward +> * In our research we use .svg files for designs, which are easy to format +> * For now, other file formats could be used if they’re converted to .svg first (e.g. more conventional CAD formats such as .dxf) +> * Most of these formats should be relatively easy to convert using Inkscape (also FOSS) +> * We use Inkscape for lal of our design work, and developing a plugin to simplify the formatting of design files for use with shapeflow could be interesting to consider for future efforts. +> * Support multiple formats for exporting results +> * Our team mainly uses Excel for other data analysis, so this is the go-to in our case +> * We use pandas for result handling, so it will be easy to add support for other formats such as .csv, .json or databases. + + + +> Should also include the .meta files & results in docs/paper as supplementary info and also host the video files somewhere other than the actual repository. + + + + + +[@Mohammed:2015]: https://doi.org/10.1016/j.protcy.2015.07.010 +[@Martinez:2010]: https://doi.org/10.1021/ac9013989 +[@Eltzov:2015]: https://doi.org/10.1002/elan.201500237 +[@Kokalj:2014]: https://doi.org/10.1039/C4LC00920G +[@DalDosso:2018]: https://doi.org/10.1007/s10544-018-0289-1 +[@DalDosso:2019]: https://doi.org/10.1016/j.sna.2019.01.005 +[@Hu:2014]: https://doi.org/10.1016/j.bios.2013.10.075 diff --git a/shapeflow/video.py b/shapeflow/video.py index 38bf0cf5..6c89d7b1 100644 --- a/shapeflow/video.py +++ b/shapeflow/video.py @@ -1817,8 +1817,8 @@ def get_coordinates(self) -> Optional[list]: return self.transform.get_coordinates() -def init(config: BaseAnalyzerConfig) -> BaseAnalyzer: - mapping: Dict[Type[BaseAnalyzerConfig], Type[BaseAnalyzer]] = { +def init(config: BaseConfig) -> BaseAnalyzer: + mapping: Dict[Type[BaseConfig], Type[BaseAnalyzer]] = { VideoAnalyzerConfig: VideoAnalyzer }