\section*{Discussion} %750 Words
%\com{this section seems quite short to me; are there other topics we should discuss? any limitations besides those mentioned? any discussion of need for potential future studies to compare diagnosis from videomosaics to that from videos or from standard mosaic? or on the contrary can we claim such studies are not needed given the ample validation of RCM for skin cancer diagnosis already published?}\com{Also how about some discussion of other arenas besides skin cancer where this might be a helpful technology?} 

In this paper, we present a new way of imaging large areas of tissue at microscopic resolution, even when the anatomical sites of interest are hard to access and/or present uneven, corrugated and irregular topology. To image such large and challenging regions of interest, clinicians must often rely on video-microscopy. Typically, a video sequence is captured over the area of interest  by moving a handheld microscope manually over the tissue. The need to maintain cellular resolution means that each frame of these videos has a small field of view , and thus the video presents a rapid succession of small correlated areas of tissue  but viewing them as a video does not reveal their spatial relationship. As an example of possible consequences, in the case of RCM imaging of skin, a recent study \cite{Castro2014} showed that diagnostic capabilities  decrease slightly when the handheld version of the microscope is used. The authors attributed this decrease to the lack of mosaicking capability of the handheld microscope, and inability to quickly examine large filed of view (large area of tissue). Video-mosaicking thus solves this problem by registering, concatenating, and stitching together microscopic images to produce a large field of view. 

However in vivo microscopic video-mosaicking is challenging for both image capture and mosaic composition. The quality of the final mosaic is sensitive to the motion of the microscope over the imaged area. The operator must to avoid rapid motion, while maintaining smooth translation across the skin and constant depth of the focal plane, with micron-level accuracy. Rapid motion can result in blurring and warping deformations in the final mosaic, while rapid change in depth can result in jumps in the imaging plane between frames. Although such artifacts can not be totally avoided during clinical imaging, one of the novelties of our approach, the scene cut detection step, can detect and handle both types of rapid motion and thus minimize these artifacts in the mosaic. 

Another novelty that distinguishes other video-mosaicking methods in the literature is our graph-cuts based seamless stitching approach. This method has previously  been used in computational photography; however, as far as we know, this is the first study that utilizes it in the microscopy setting. The challenge it solves is that traditional blending methods will lead to blur, and thus loss of the cellular resolution that is critical to diagnosis, while image-to-image variability and edge artifacts in the images make an a priori fixed cut-and-stitch approach suboptimal. Using graph-cuts based stitching, we allow the data itself to drive the merging of adjacent overlapping images, thus preserving the resolution of the original images without altering pixel values, while providing maximally smooth transitions, across stitching seams.

However, one current challenge of video-mosaicking is processing delay. Our current implementation  stitches a 500 frame video (where each frame is 1000 pixels on a side, for a total of of 500 megapixels) into a video-mosaic in less than 30 minutes, using a MATLAB based implementation with a few C MEX libraries. The timing varies depending on the specifics of the scene geometry, which affects the number of reliable keypoint matches that are used in the registration step. This is adequate for some clinical settings and indeed is being actively validated by our clinicians, as in the examples shown in the Results section. However this delay is clearly an impediment to wider adoption; being able to present  video-mosaics on-the-fly to the clinician would provide valuable live visual feedback, which would not only make it more clinically useful but would also help decrease motion artifacts and ensure appropriate coverage of the region of interest.  Currently, the registration step is the bottleneck to increasing the speed of video-mosaic composition. We note that our MATLAB code is not optimized for such processing, and thus we are confident that significant increase in speed is feasible without significant loss of performance. Highly efficient codes have already been developed in C and C++ that provide real time feature extraction and tracking capabilities, such as in the OpenCV computer vision library \cite{opencv_library,mexopencv}. In addition, all the registration steps, including the SIFT keypoint extraction, matching, and RANSAC-based keypoint elimination steps, are parallelizable and could also be implemented on GPUs for further acceleration. Therefore, we believe that substantial increase in computational speed will be achieved, enabling stitching that essentially keeps up with the image acquisition.

Another approach to lessen motion artifacts is the potential availability of smaller and faster microscopes with frame rates higher than the current 7 frames per second. Besides, with increase in processing speed, smaller microscopes would allow enhanced operator control of free-hand movement and, along with higher frame rates, further facilitate real-time stitching, thus improving  both the quality of the mosaics as well as the ability to rapidly and reliably cover an entire arbitrarily shaped region of interest. Availability of real-time video-mosaicking has the potential to enable the clinicians to be more time/cost efficient and precise in their diagnostic assessments and surgical practice. 

Finally, as shown by the clinical examples in the results section, video-mosaicking has the potential to open new alleys in imaging based diagnosis and surgery, that in the past the clinicians were not able to do due to technical limitations. Moreover, the initial clinical success in imaging skin, is being translated to other setting and applications. One example is video-microscopy in the oral cavity. Head and neck surgery group in our institute is currently testing handheld microscope with a new telescopic probe for intra-oral imaging during head-neck surgery. Testing has thus far been performed on then patients, with video-mosaic being assessed for correlation to pathology for delineation of margins. Again real-time mosaicing has the potential to provide live feedback to the surgeon and make surgical planning and procedure more efficient. 

Need for video-mosaicking has already raised in other fields such as video-microscopy of oral cavity, where confocal microscopy has also begun to show its usability. Head and neck group in our institute is currently testing a new telescopic attachment on the handheld microscope, which was designed by our group, to acquire video-microscopy videos. Their investigate the potential use of video-microscopy in image guided surgery of the oral cancer patients. The videos that they acquire during in the OR are converted into video-mosaics for diagnostic correlation studies. Again, real-time video-mosaicking has the provide critical feedback to the surgeon throughout the surgery and make surgical planing and procedure more efficient. 
%%%%%%




%Imaging large areas of biological samples and tissue with high (cellular) resolution helps the clinician and researchers to avoid sampling errors, and examine cellular formations and patterns over larger areas. These two issues are crucial for making robust deductions in case of researchers and reliable diagnosis in case of clinicians. However, resolution and field of view are inversely proportional in microscopy. Therefore, it is not feasible to obtain both high-resolution in a large FOV in a single view. Mosaicking techniques offer a solution to this problem by concatenating/stitching together individual small field of view microscopic images captured over a region of interest and forming a large FOV, high-resolution image of the area. Mosaicking algorithms are mainly composed of 2 steps, registration and stitching. In order to create high quality mosaics, it is important to have high-quality outputs in both steps. Registration is mostly related to the motion of the image acquisition device over the imaged area. In many settings, such as ex-vivo imaging of fresh tissue \cite{SanjeeJBO2013}, researchers simplified the registration problem by controlling and/or predefining the motion of the imaging device is controlled and predefined. This idea has also been applied to in-vivo imaging, where the area of interest is easily accessible and can be fixed under the imaging device.

%On the other hand, for lesions at hard to access areas, such as head or genitals, or any curved part of the body surface, where the microscope can not be attached, clinicians -if available- use a handheld version of the device for imaging. In case of RCM, the handheld microscope enables the user to move freely over the area of interest, and capture microscopic videos covering large regions rapidly in an adaptive fashion. Therefore, an RCM video contains all the necessary visual information overall imaging region. However, it is harder for the clinicians/researchers to appreciate the diagnostic significance of the microscopic videos since each frame contains a limited FOV and scrolling back and forth between the frames is not efficient. For example, a recent study \cite{Castro2014} showed that diagnostic capabilities of RCM imaging slightly decreases when the handheld version of the microscope is used for diagnosis. The authors related this issue to the lack of mosaicking capability of the handheld microscope. Furthermore, researchers have already been using the videomosaicking technology to enable rapid evaluation of residual tumor margins directly in the surgical wounds of \com{non-melanoma skin cancer}{keratinocyte carcinoma} patients \cite{EileenJBO}, and assessment of superficial basal cell carcinomas treated with laser ablation \cite{SierraCDAblation}.  Therefore, developing videomosaicking techniques for expanding the FOV of RCM while enabling arbitrary shaped larger areas to be covered in a rapid fashion is a key need \cite{AnthonyFO2015}.

%One key challenge is the lack of position feedback while collecting RCM videos in a free-hand manner. Therefore, registration parameters between consecutive frames need to be estimated from the images themselves. Moreover, the registered frames must be stitched in a seamless manner without causing any loss of resolution. The algorithm presented here, brings innovations to both registration, and stitching stages. Using our data-driven approach, registration parameters can be estimated from the captured images, and therefore the motion of the imaging device does not need to be predefined. Furthermore, lack of control and feedback may also lead to motion-related artifacts during imaging, such as scene-cuts mentioned earlier. The regularized RANSAC-based solution minimizes the occurrence of scene-cuts in videomosaicking.  Only if the scene-cut is unavoidable, the algorithm locates it automatically by analyzing the final registration transformation between consecutive frames.

%One limitation of our data-driven registration method is that it heavily relies on the number of reliable keypoint matches, and their distribution. We ideally want the matches to be distributed homogeneously over the frames, therefore the final registration parameter estimation represents the overall frame registration. Especially over smooth areas where there is a lack of texture, this issue becomes a problem. In such cases, we can typically find a small amount of reliable matches focal to an area in the frame. In this case, the overall estimate overfits to a small are in the frames and leads to distortions at the other areas. In such cases, it may be possible to adapt the feature extraction threshold of the algorithm and let it generate weaker features, which will hopefully be matched.

%In the stitching phase, most of the mosaicing methods in the literature use blending or methods derived from blending, which may lead to blurring artifacts or loss of resolution in the final results. The stitching method that we developed actually uses real pixel values from the captured images and optimizes the coherence of the final mosaic while determining the stitching border. In this way, we avoid such artifacts introduced by blending based algorithms.

%The current implementation of the videomosaicking algorithm can stitch a 500 frame video into a video-mosaic in less than 30 minutes (MATLAB based implementation with a few C MEX libraries used). The timing varies depending on the scene geometry as it affects the number the reliable keypoint matches that are used in the registration step. Currently, the registration step is the bottleneck in increasing the speed of video-mosaic composition. However, all the registration steps, such as SIFT keypoint extraction, matching, and RANSAC-based keypoint elimination steps are parallelizable and can be implemented for GPU processing, therefore, \com{real-time stitching is possible}{ORIOL: Need to emphasize this??}. Composing the video-mosaic on-the-fly is very useful as it provides live visual feedback to the user so that most of the above-mentioned motion artifacts can be precluded by adjusting the motion/speed of the microscope accordingly. Moreover, such visual feedback eases the coverage area problem as the user can on-the-fly see the video-mosaic and arrange the motion of the microscope accordingly to cover the area of interest.

%In the hands of the early-adopter clinicians, videomosaicing offers new ways of examining skin lesions and planning treatments