{"id":1132,"date":"2011-03-03T11:37:38","date_gmt":"2011-03-03T11:37:38","guid":{"rendered":"http:\/\/labrigger.com\/blog\/?p=1132"},"modified":"2011-03-03T11:38:01","modified_gmt":"2011-03-03T11:38:01","slug":"more-matlab-code-for-2p-scope-design","status":"publish","type":"post","link":"http:\/\/labrigger.com\/blog\/2011\/03\/03\/more-matlab-code-for-2p-scope-design\/","title":{"rendered":"More MATLAB code for 2p scope design"},"content":{"rendered":"<p align=\"center\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/labrigger.com\/blog\/wp-content\/uploads\/2011\/03\/coll2.png\" alt=\"\" title=\"The MATLAB code for generating this graph is at the bottom of the post.\" width=\"510\" height=\"422\" class=\"aligncenter size-full wp-image-1138\" srcset=\"http:\/\/labrigger.com\/blog\/wp-content\/uploads\/2011\/03\/coll2.png 510w, http:\/\/labrigger.com\/blog\/wp-content\/uploads\/2011\/03\/coll2-300x248.png 300w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/><\/p>\n<p>In the <a href=\"http:\/\/labrigger.com\/blog\/2011\/02\/26\/matlab-code-for-designing-collection-optics-for-2p-scopes\/\">last post<\/a>, I mentioned how the &#8220;minification&#8221; factor (the diameter of the PMT detector divided by the diameter or the back plane of the objective), greatly affects the layout of the collection optics. Here&#8217;s a graph and the associated MATLAB code for looking at this relationship. If you need to fit two dichroics in the collection pathway (IR\/vis and red\/green, for example) then you&#8217;ll need a larger distance between the objective and the collection lens. <\/p>\n<p>Also consider the diameter of the objective&#8217;s back plane. If it is one of the large NA, low mag objectives, it will be quite large and you&#8217;ll want to use at least a 25mm collection lens, if not larger. By contrast, if you&#8217;re using a 40x\/0.8 objective, you can probably get away with smaller lenses and closer positioning.<\/p>\n<p><font size=2><\/p>\n<pre>\r\n%% Magnification, dist_obj_cl, f_cl\r\n% Eqn. 3.21 from Tsai et al. 2009 (CRC); abs(mag)=f_cl\/(dist_obj_cl-f_cl)\r\n% Can be rewritten dist_obj_cl = (f_cl\/mag) + f_cl\r\n% Below, for brevity, we use L1 = dist_obj_cl\r\n\r\nclear f_cl L1\r\n% Make a family of curves relating these quantities.\r\nf_cl = 5:5:50; % Collection lens focal lengths, in mm.\r\nmag = 0.2:0.05:0.5; % Magnification factors.\r\n\r\nfor m=1:numel(mag)\r\n    for f=1:numel(f_cl)\r\n        L1(f,m) = (f_cl(f)\/mag(m)) + f_cl(f);\r\n    end\r\nend\r\n\r\nfor m=1:numel(mag)\r\n    M{m}=num2str(mag(m)); % Labels for the different mag lines\r\nend\r\nfigure\r\nplot(f_cl,L1);\r\nxlabel('f_C_L: Focal length of collection lens (mm)')\r\nylabel('L_1: Distance from objective back plane to collection lens (mm)')\r\nlegend(M,'Location','NorthWest')\r\nlegend('boxoff')\r\ntitle('Relation between f_C_L and L_1 for different magnifications')\r\n<\/pre>\n<p><\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p align=\"center\">\n<p>In the <a href=\"http:\/\/labrigger.com\/blog\/2011\/02\/26\/matlab-code-for-designing-collection-optics-for-2p-scopes\/\">last post<\/a>, I mentioned how the &#8220;minification&#8221; factor (the diameter of the PMT detector divided by the diameter&#8230;<\/p>\n<div class=\"read-more\"><a href=\"http:\/\/labrigger.com\/blog\/2011\/03\/03\/more-matlab-code-for-2p-scope-design\/\">Read More<\/a><\/div><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[26,15],"class_list":["post-1132","post","type-post","status-publish","format-standard","hentry","category-software","tag-matlab","tag-optics"],"_links":{"self":[{"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/posts\/1132","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/comments?post=1132"}],"version-history":[{"count":8,"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/posts\/1132\/revisions"}],"predecessor-version":[{"id":1141,"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/posts\/1132\/revisions\/1141"}],"wp:attachment":[{"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/media?parent=1132"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/categories?post=1132"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/labrigger.com\/blog\/wp-json\/wp\/v2\/tags?post=1132"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}