a generalized fd - oct system used to collect 3 - d image data suitable for use with the present invention is illustrated in fig1 . a fd - oct system includes a light source 101 , typical sources including but not limited to broadband light sources with short temporal coherence lengths or swept laser sources . ( see for example , wojtkowski , et al ., “ three - dimensional retinal imaging with high - speed ultrahigh - resolution optical coherence tomography ,” ophthalmology 112 ( 10 ): 1734 2005 or lee et al . “ in vivo optical frequency domain imaging of human retina and choroid ,” optics express 14 ( 10 ): 4403 2006 the contents of both of which is hereby incorporated by reference ) light from source 101 is routed , typically by optical fiber 105 , to illuminate the sample 110 , a typical sample being tissues at the back of the human eye . the light is scanned , typically with a scanner 107 between the output of the fiber and the sample , so that the beam of light ( dashed line 108 ) is scanned over the area or volume to be imaged . light scattered from the sample is collected , typically into the same fiber 105 used to route the light for illumination . reference light derived from the same source 101 travels a separate path , in this case involving fiber 103 and retro - reflector 104 . those skilled in the art recognize that a transmissive reference path can also be used . collected sample light is combined with reference light , typically in a fiber coupler 102 , to form light interference in a detector 120 . the output from the detector is supplied to a processor 130 . the results can be stored in the processor or displayed on display 140 . the processing and storing functions may be localized within the oct instrument or functions may be performed on an external processing unit to which the collected data is transferred . this unit could be dedicated to data processing or perform other tasks which are quite general and not dedicated to the oct device . the interference causes the intensity of the interfered light to vary across the spectrum . the fourier transform of the interference light reveals the profile of scattering intensities at different path lengths , and therefore scattering as a function of depth ( z - direction ) in the sample ( see for example leitgeb et al . “ ultrahigh resolution fourier domain optical coherence tomography ,” optics express 12 ( 10 ): 2156 ( 2004 )). the profile of scattering as a function of depth is called an axial scan ( a - scan ). a set of a - scans measured at neighboring locations in the sample produces a cross - sectional image ( tomogram or b - scan ) of the sample . a collection of b - scans collected at different transverse locations on the sample makes up a data volume or cube . the sample and reference arms in the interferometer could consist of bulk - optics , fiber - optics or hybrid bulk - optic systems and could have different architectures such as michelson , mach - zehnder or common - path based designs as would be known by those skilled in the art . light beam as used herein should be interpreted as any carefully directed light path . in time - domain systems , the reference arm needs to have a tunable optical delay to generate interference . balanced detection systems are typically used in td - oct and ss - oct systems , while spectrometers are used at the detection port for sd - oct systems . the invention described herein could be applied to any type of oct system . the system is typically enclosed in a housing with various patient positioning components including chin and headrest . oct systems can have additional imaging modalities incorporated into the system to aid in alignment or provide additional clinical information . one example of such a system is illustrated in fig2 and described in detail in us patent application us 2007 / 0291277 hereby incorporated by reference and realized in the commercially available product cirrus hd - oct ( carl zeiss meditec , inc . dublin , calif .). in this system , an iris viewer and a line scanning opthalmoscope ( lso ) are operated in conjunction with an oct system . the lso provides a view of the fundus in parallel to the oct information . the iris camera provides a view of the iris of the patient &# 39 ; s eye and is used primarily to align the patient &# 39 ; s eye with the optical axis of the device . the iris viewer includes an led for illuminating the eye typically positioned close to the ocular lens 201 . preferably , the led generates light having a wavelength of about 700 nm . the reflected 700 nm light is captured by lens 201 and travels back through splitter bs 1 to splitter bs 2 where it is reflected back through a series of lenses to a cmos camera . the camera generates an output which is supplied to a monitor that will display an image of the iris on a user interface of the device . in a first embodiment of the present invention , the oct system is equipped with a system to detect the presence and identify the type of an add - on external lens that can be attached to the outside of the instrument to enable to system to operate in different imaging modes . in a preferred embodiment of the present invention , the external lens module is used for anterior segment scanning of human eye using an oct instrument . in the preferred embodiment it is possible to detect the presence of an add - on external lens module on the ocular housing of an oct instrument without using electrical or electro - mechanical sensors . it can be accomplished using optical components of the iris camera . this is advantageous in that it can allow upgrades to existing commercial systems without extensive hardware rework , only new software and the desired lens module need to be installed in the field . fig3 illustrates a preferred embodiment for detecting the presence and identifying add - on lenses to an ophthalmic oct system . a section of the instrument housing ( labeled ocular housing 310 ) holding the ocular lens 312 in place is illustrated . one or more lenses are mounted on an injection molded housing or fixture 314 ( add - on lens and housing ) and attached to the ocular housing , preferably using magnets though other means of attachment could be envisioned by those skilled in the art . in practice , one type of add - on lens could be used for pachymetry measurements and narrows the field of view . alternatively , sometimes a field of view wider than is available with the primary lens 312 is desired and a different add - on lens can provide that wider field of view . in a preferred embodiment , part of one or more of the add - on lenses is provided with a small diffused feature on its outer rim . the diffused feature can be created by painting a small part or area of the lens white or gray . alternatively , a small area of the injection molded housing where the lens is held in place can be painted . light from light source 318 in the ocular housing used for the iris camera 320 as described in reference to fig2 illuminates the diffused feature on or behind the lens and is imaged through a light mask 324 onto the instrument &# 39 ; s viewing camera . the mask 324 is provided with transparent regions that provide a code indicative of the type of add - on lens being used . in a most basic example , where there are two different types of add - on lenses , the mask associated with one type of lens could have a single opening and the mask associated with the second type of lens could have two openings . the diffused light pattern transmitted by these openings is imaged by camera 320 . the image is analyzed using an algorithm as will be described in further detail below to indicate the presence and type of the add - on external lens module on the instrument &# 39 ; s ocular housing . different patterns of diffuse light could be used to identify different lens elements and in response thereto the system could make automatic adjustments with account for the change in the field of view or depth . such changes could include adjusting the length of the reference arm or inserting or removing a “ flip - in ” lens in the sample arm path located within the instrument housing . in a preferred embodiment , a prism 330 can be mounted on the module &# 39 ; s housing for illuminating the patient &# 39 ; s eye when the add - on module is placed on the instrument &# 39 ; s ocular housing . the prism helps correct for the fact that module changes the working distance to the eye so that the light from source 318 would not be properly directed to the eye absent the prism . an algorithm that can be used to detect and identify the add - on lens will now be described in further detail . fig4 a and 4 b show two images collected on the ophthalmic system &# 39 ; s iris camera with two different types of external lens modules attached to the instrument . two small spots of light ( 410 , 412 ) can be seen at the bottom of the image in fig4 a . this would correspond to a mask having two openings transmitting the diffuse light . in contrast , in fig4 b , one small spot 414 can be seen at the bottom of the image , corresponding to a mask having one opening transmitting the diffuse light . an image collected without the add - on lens module attached is illustrated in fig4 c for comparison . the spots can be isolated from the image using various imaging processing techniques as would be appreciated by someone skilled in the art . here connected component analysis is used to generate an image as shown in fig5 . two distinct spots of light are evident . the centroids of the spots can be identified and used to generate vertical profiles in the image as shown in fig6 . the lines ( 610 , 612 , 614 ) are drawn through regions of maximum and minimum intensity in the image . the vertical intensity profiles of these lines are plotted as shown in fig7 a and cross - correlations between these vertical profiles can be analyzed . the normalized cross correlations between two of the profiles ( 610 , 614 ) is much higher ( 0 . 9615 ) than the others ( 0 . 2909 and 0 . 0326 ) indicating two relatively strong “ peaks ”. this is used to indicate the presence of the add - on lens with two distinct spots . in comparison the cross - correlations for the image taken without the external lens module are shown in fig7 b . in an alternative embodiment of the present invention , template matching could be also used to detect the spots . a 2 - d normalized cross - correlation function between the image and each template as shown in fig7 c can indicate the location of the templates . it is assumed that the amount of rotation , scaling or shear ( affine transform ) is not significant to affect the performance of 2 - d normalized cross - correlation . the resulting output of the 2 - d normalized cross - correlation function is a 2 - d map λ ( u , v ), which can range from − 1 and 1 . the position ( x , y ) of the maximum value γ max in this map represents the center location of the template within the image . the type and presence of the add - on lens is based on the number and locations of the spots with high γ max values ( e . g . & gt ; 0 . 9 ). here the cross correlations are relatively equal ( or high ) and indicate the absence of the external lens . as mentioned above , various patterns could be used for different lenses and more complex algorithms could be used to identify different external lens modules and imaging properties such as reference arm adjustment , scan type , and scan geometry could be automatically adjusted on the instrument based on the identification . while the preferred embodiment utilized light from the iris camera , it would be possible to use a other light sources and cameras that may be present in the system as would be appreciated by someone skilled in the art . in optical coherence tomography , the best signal to noise ratio and lateral resolution are achieved when the beam is focused to a small spot within the object of interest . in ophthalmic oct , the position of the beam focus is affected by the subjects own optics which vary widely from person to person . therefore it is typical to adjust the optical properties of the oct device to bring the desired tissue into focus such that an acceptable image is acquired . in the past , oct focus has been set in a number of ways including but not limited to : manually focusing to a criteria where the operator found the image most acceptable , systematically stepping through focal positions to build up a tomogram consisting of many well focused layers , simultaneously acquiring tomograms at multiple focal positions , automatically optimizing some external signal , for example maximizing the signal returned from a simultaneously acquired confocal scanning laser opthalmoscope with a known focal position relative to the oct , automatically optimizing a global parameter over the entire oct image such as maximizing image entropy , or peak signal intensity , and automatically optimizing a parameter such as entropy or peak signal for a particular tissue layer of interest . a second embodiment of the present invention increases the signal to noise ratio and lateral resolution of an optical coherence tomogram at a specified tissue layer . it does this by applying an offset to a focal position found by a traditional autofocus algorithm . the present solution is superior to previous solutions because it allows for focus position to be optimized for a particular tissue layer of interest , that may have weak or otherwise unsuitable signal for determining focus , in a way that takes advantage of the relative ease of finding a nearby layer . the system first automatically finds focus of an easily identified layer using either an oct beam or a probe beam of an alternate modality such as confocal imaging . a traditional algorithm may be able to precisely locate some features of a tissue such as by maximizing signal at a tissue boundary or at a tissue location known to have particularly high signal or contrast of some sort . for example , the retinal pigment epithelium ( rpe ) often provides such a bright , high contrast layer in the posterior eye . the actual layer of interest may be more difficult to find by such an algorithm because it has low signal or contrast . the choroid and vitreous are examples of such layers . the system dynamically determines an offset to the tissue of interest — either by examining preliminary oct data , or by applying a known offset for a particular tissue type . this determining of offset maybe performed before or after best focus is found at the ‘ easy layer ’. the distance offset to the actual layer of interest may be known or estimated a priori , or the offset may be measured from properties of the optical coherence tomogram . when the offset is determined , the optical path of the system can be adjusted to move the focus to provide best signal at the offset layer . the device may always optimize to the same tissue layer as determined dynamically from oct data . the system applies the offset to the oct beam away from the optimum focus at the easy layer . this may happen sequentially after first finding the easy layer and then stepping away , or may occur simultaneously such that the oct beam focused on the layer of interest is shifted away from a simultaneously acquired beam that remains focused on the easy layer . the latter method would allow for focus tracking if focus might change , such as by eye accommodation . the operator may select to have the view optimized by the device for a particular tissue from a list of possible tissue layers , or at a specified offset from a particular tissue layer . the operator may select a particular analysis from the device and the device will select to acquire tomograms at the focus position or positions best suited to make the analysis , and those analyses would then be provided to the instrument user . some image processing methods , such as interferometric synthetic aperture microscopy ( see for example ralston et al . “ interferometric synthetic aperture microscopy ” nature physics 3 , 129 - 134 2007 ) may actually have advantages when used with the oct beam slightly out of focus at the tissue layer of interest , such that the information from a single location is spread to multiple measurements which can later be combined . in such a case , the above method could be used to apply an optimal focus , which is itself at an offset from the particular layer of interest . in this case the layer of interest could be the easily found layer . in a further embodiment of the present invention , the system is able to dynamically adjust the optical output power of an oct system . commonly the optical output power of an oct system is adjusted to a fixed optical output power which is below the worst case maximum permissible exposure ( mpe ) value of all the imaging modes of the device . however , different imaging modes could benefit from different optical output powers . there are cases where the power may be reduced , for example during alignment , in case sufficient image quality is achieved also with lower power . or when highly reflective samples are scanned , which may cause the detector to saturate when imaged with too much sample power ( e . g . the central part of the cornea ). and there are other cases where the image quality is unsatisfactory while the optical output power is significantly below the mpe value for the current scan mode , for example for extremely short scans , where the probing beam is scanned very quickly over a large area on the retina . in such cases the device may use its image quality information of the alignment scans in order to set the optical output power for the acquisition . since higher optical power incident on the sample directly results in better system sensitivity , the image quality could be significantly improved . in an alternative embodiment , the device could adjust the optical output power in general to the mpe for the current imaging mode . this would ensure maximum sensitivity for each imaging mode , rather than limiting the system &# 39 ; s output power and therefore system sensitivity according to the worst case imaging mode . in one case , the mode could depend on the location of the tissue being imaged . the mpe for an anterior segment imaging mode is in general higher than the mpe for a posterior segment imaging mode so the system could be configured to image at higher powers for scans in the anterior segment . although various applications and embodiments that incorporate the teachings of the present invention have been shown and described in detail herein , those skilled in the art can readily devise other varied embodiments that still incorporate these teachings . although the description of the present invention is discussed herein with respect to the sample being a human eye , the applications of this invention are not limited to eye and can be applied to any application using oct . nassif et al . “ in vivo human retinal imaging by ultrahigh - speed spectral domain optical coherence tomography ” optics letters 29 ( 5 ): 480 2004 . choma , m . a ., et al . “ sensitivity advantage of swept source and fourier domain optical coherence tomography ” optics express 11 ( 18 ): 2183 2003 . hee et al ., “ optical coherence tomography for ophthalmic imaging ,” iee engineering in medicine and biology , january / february 1995 . wojtkowski , et al ., “ three - dimensional retinal imaging with high - speed ultrahigh - resolution optical coherence tomography ,” ophthalmology 112 ( 10 ): 1734 2005 . lee et al . “ in vivo optical frequency domain imaging of human retina and choroid ,” optics express 14 ( 10 ): 4403 2006 . leitgeb et al . “ ultrahigh resolution fourier domain optical coherence tomography ,” optics express 12 ( 10 ): 2156 ( 2004 ). ralston et al . “ interferometric synthetic aperture microscopy ” nature physics 3 , 129 - 134 2007 .
systems and methods for improvements to optical coherence tomography systems for operating in different imaging modes are presented . in one embodiment , a system for identifying the presence and type of an adjunct lens operably connected to the oct instrument for changing between imaging modes in the system is described . in a second embodiment , a system for dynamically autofocusing the oct system depending on the layer of interest is presented . in a third embodiment , the overall power of the system used for imaging can be adjusted depending on the location and type of scan desired while accounting for the safety standards for recommended light exposure .