(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 10.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[    288497,       6099]
NotebookOptionsPosition[    287295,       6058]
NotebookOutlinePosition[    287722,       6076]
CellTagsIndexPosition[    287679,       6073]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[
 RowBox[{"\[IndentingNewLine]", 
  RowBox[{"(*", 
   RowBox[{"Deklarace", " ", "funkc\[IAcute]"}], "*)"}], 
  "\[IndentingNewLine]", 
  RowBox[{"(*", 
   RowBox[{"Vykreslen\[IAcute]", " ", "legendy", " ", "v", " ", "grafech"}], 
   "*)"}], "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"plotlabel", "[", 
     RowBox[{"data_", ",", "h_", ",", "w_", ",", "caption_"}], "]"}], ":=", 
    RowBox[{"{", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"stylesp", "=", 
       RowBox[{
        RowBox[{"DeleteCases", "[", 
         RowBox[{
          RowBox[{"Flatten", "[", " ", 
           RowBox[{
            RowBox[{"Cases", "[", 
             RowBox[{"data", ",", 
              RowBox[{
               RowBox[{"{", 
                RowBox[{"dir__", ",", "p_Point"}], "}"}], "\[RuleDelayed]", 
               RowBox[{"{", "dir", "}"}]}], ",", "\[Infinity]"}], "]"}], ",", 
            "1"}], "]"}], ",", "_Hue"}], "]"}], "/.", 
        RowBox[{
         RowBox[{"PointSize", "[", "_", "]"}], "\[Rule]", 
         RowBox[{"PointSize", "[", "0.03", "]"}]}]}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"stylesl", "=", 
       RowBox[{"Flatten", "[", 
        RowBox[{
         RowBox[{"Cases", "[", 
          RowBox[{"data", ",", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{"dir__", ",", "l_Line"}], "}"}], "\[RuleDelayed]", 
            RowBox[{"{", "dir", "}"}]}], ",", "\[Infinity]"}], "]"}], ",", 
         "1"}], "]"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"Graphics", "[", 
       RowBox[{"{", 
        RowBox[{
         RowBox[{"EdgeForm", "[", 
          RowBox[{"Thickness", "\[Rule]", "1"}], "]"}], ",", "White", ",", 
         RowBox[{"Rectangle", "[", 
          RowBox[{
           RowBox[{"{", 
            RowBox[{"0", ",", "0"}], "}"}], ",", 
           RowBox[{"{", 
            RowBox[{"w", ",", "h"}], "}"}]}], "]"}], ",", "Black", ",", 
         RowBox[{
          RowBox[{
           RowBox[{"Style", "[", 
            RowBox[{
             RowBox[{"Text", "[", 
              RowBox[{
               RowBox[{"#", "[", 
                RowBox[{"[", "1", "]"}], "]"}], ",", 
               RowBox[{"{", 
                RowBox[{
                 RowBox[{"0.3", "w"}], ",", 
                 RowBox[{
                  RowBox[{"(", 
                   RowBox[{"h", "/", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", 
                    RowBox[{"Join", "[", 
                    RowBox[{"stylesl", ",", "stylesp"}], "]"}], "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], ")"}], 
                  RowBox[{"#", "[", 
                   RowBox[{"[", "2", "]"}], "]"}]}]}], "}"}], ",", "Left"}], 
              "]"}], ",", 
             RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
             RowBox[{"FontSize", "\[Rule]", "12"}]}], "]"}], "&"}], "/@", 
          RowBox[{"Join", "[", 
           RowBox[{
            RowBox[{"Partition", "[", 
             RowBox[{
              RowBox[{"caption", "[", 
               RowBox[{"[", 
                RowBox[{"1", ";;", 
                 RowBox[{
                  RowBox[{"Dimensions", "[", 
                   RowBox[{"Join", "[", 
                    RowBox[{"stylesl", ",", "stylesp"}], "]"}], "]"}], "[", 
                  RowBox[{"[", "1", "]"}], "]"}]}], "]"}], "]"}], ",", "1"}], 
             "]"}], ",", 
            RowBox[{"Partition", "[", 
             RowBox[{
              RowBox[{"Range", "[", 
               RowBox[{"0.5", ",", 
                RowBox[{
                 RowBox[{"Dimensions", "[", 
                  RowBox[{"Join", "[", 
                   RowBox[{"stylesl", ",", "stylesp"}], "]"}], "]"}], "[", 
                 RowBox[{"[", "1", "]"}], "]"}]}], "]"}], ",", "1"}], "]"}], 
            ",", "2"}], "]"}]}], ",", "\[IndentingNewLine]", 
         "\[IndentingNewLine]", 
         RowBox[{
          RowBox[{
           RowBox[{"{", 
            RowBox[{
             RowBox[{"#", "[", 
              RowBox[{"[", "1", "]"}], "]"}], ",", 
             RowBox[{"If", "[", 
              RowBox[{
               RowBox[{
                RowBox[{"#", "[", 
                 RowBox[{"[", "2", "]"}], "]"}], "<", 
                RowBox[{
                 RowBox[{"Dimensions", "[", "stylesp", "]"}], "[", 
                 RowBox[{"[", "1", "]"}], "]"}]}], ",", 
               RowBox[{"Point", "[", 
                RowBox[{"{", 
                 RowBox[{
                  RowBox[{"0.2", "w"}], ",", 
                  RowBox[{
                   RowBox[{"(", 
                    RowBox[{"h", "/", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", 
                    RowBox[{"Join", "[", 
                    RowBox[{"stylesl", ",", "stylesp"}], "]"}], "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], ")"}], 
                   RowBox[{"#", "[", 
                    RowBox[{"[", "2", "]"}], "]"}]}]}], "}"}], "]"}], ",", 
               RowBox[{"Line", "[", 
                RowBox[{"{", 
                 RowBox[{
                  RowBox[{"{", 
                   RowBox[{
                    RowBox[{"0.1", "w"}], ",", 
                    RowBox[{
                    RowBox[{"(", 
                    RowBox[{"h", "/", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", 
                    RowBox[{"Join", "[", 
                    RowBox[{"stylesl", ",", "stylesp"}], "]"}], "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], ")"}], 
                    RowBox[{"#", "[", 
                    RowBox[{"[", "2", "]"}], "]"}]}]}], "}"}], ",", 
                  RowBox[{"{", 
                   RowBox[{
                    RowBox[{"0.2", "w"}], ",", 
                    RowBox[{
                    RowBox[{"(", 
                    RowBox[{"h", "/", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", 
                    RowBox[{"Join", "[", 
                    RowBox[{"stylesl", ",", "stylesp"}], "]"}], "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], ")"}], 
                    RowBox[{"#", "[", 
                    RowBox[{"[", "2", "]"}], "]"}]}]}], "}"}]}], "}"}], 
                "]"}]}], "]"}]}], "}"}], "&"}], "/@", 
          RowBox[{"Join", "[", 
           RowBox[{
            RowBox[{"Partition", "[", 
             RowBox[{
              RowBox[{"Join", "[", 
               RowBox[{"stylesp", ",", "stylesl"}], "]"}], ",", "1"}], "]"}], 
            ",", 
            RowBox[{"Partition", "[", 
             RowBox[{
              RowBox[{"Range", "[", 
               RowBox[{"0.5", ",", 
                RowBox[{
                 RowBox[{"Dimensions", "[", 
                  RowBox[{"Join", "[", 
                   RowBox[{"stylesl", ",", "stylesp"}], "]"}], "]"}], "[", 
                 RowBox[{"[", "1", "]"}], "]"}]}], "]"}], ",", "1"}], "]"}], 
            ",", "2"}], "]"}]}]}], "\[IndentingNewLine]", "}"}], "]"}]}], 
     "}"}]}], "\[IndentingNewLine]", 
   RowBox[{"(*", 
    RowBox[{
    "Normalizace", " ", "pozad\[IAcute]", " ", "sn\[IAcute]mk\[URing]"}], 
    "*)"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"imagenormalization", "[", 
     RowBox[{
     "imagedata_", ",", "normalizationdata_", ",", "usednormalizatondata_"}], 
     "]"}], ":=", "\[IndentingNewLine]", 
    RowBox[{"Flatten", "[", 
     RowBox[{"If", "[", 
      RowBox[{
       RowBox[{"And", "[", 
        RowBox[{
         RowBox[{
          RowBox[{
           RowBox[{"Dimensions", "[", "imagedata", "]"}], "[", 
           RowBox[{"[", "1", "]"}], "]"}], ">", "0"}], ",", 
         RowBox[{
          RowBox[{
           RowBox[{"Dimensions", "[", "normalizationdata", "]"}], "[", 
           RowBox[{"[", "1", "]"}], "]"}], ">", "0"}]}], "]"}], ",", 
       "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"backgrounds", "=", 
         RowBox[{"Flatten", "[", 
          RowBox[{
           RowBox[{"Partition", "[", 
            RowBox[{
             RowBox[{"Partition", "[", 
              RowBox[{
               RowBox[{"Flatten", "[", 
                RowBox[{"normalizationdata", ",", "1"}], "]"}], ",", 
               RowBox[{"imagesizex", "/", "pixelbinning"}]}], "]"}], ",", 
             RowBox[{"{", 
              RowBox[{
               RowBox[{"imagesizey", "/", "pixelbinning"}], ",", 
               RowBox[{"imagesizex", "/", "pixelbinning"}]}], "}"}]}], "]"}], 
           ",", "1"}], "]"}]}], ";", "\[IndentingNewLine]", 
        RowBox[{"contacts", "=", 
         RowBox[{"Flatten", "[", 
          RowBox[{
           RowBox[{"Partition", "[", 
            RowBox[{
             RowBox[{"Partition", "[", 
              RowBox[{
               RowBox[{"Flatten", "[", 
                RowBox[{"imagedata", ",", "1"}], "]"}], ",", 
               RowBox[{"imagesizex", "/", "pixelbinning"}]}], "]"}], ",", 
             RowBox[{"{", 
              RowBox[{
               RowBox[{"imagesizey", "/", "pixelbinning"}], ",", 
               RowBox[{"imagesizex", "/", "pixelbinning"}]}], "}"}]}], "]"}], 
           ",", "1"}], "]"}]}], ";", "\[IndentingNewLine]", 
        RowBox[{"Table", "[", 
         RowBox[{
          RowBox[{"Image", "[", 
           RowBox[{
            RowBox[{"Quiet", "[", 
             FractionBox[
              RowBox[{
               RowBox[{"contacts", "[", 
                RowBox[{"[", "i", "]"}], "]"}], "-", 
               RowBox[{"Min", "[", 
                RowBox[{"contacts", "[", 
                 RowBox[{"[", "i", "]"}], "]"}], "]"}]}], 
              RowBox[{
               RowBox[{"backgrounds", "[", 
                RowBox[{"[", "usednormalizatondata", "]"}], "]"}], "-", 
               RowBox[{"Min", "[", 
                RowBox[{"backgrounds", "[", 
                 RowBox[{"[", "usednormalizatondata", "]"}], "]"}], "]"}]}]], 
             "]"}], "/.", 
            RowBox[{"{", 
             RowBox[{
              RowBox[{"ComplexInfinity", "\[Rule]", "1"}], ",", 
              RowBox[{"Indeterminate", "\[Rule]", "1"}]}], "}"}]}], "]"}], 
          ",", 
          RowBox[{"{", 
           RowBox[{"i", ",", 
            RowBox[{
             RowBox[{"Dimensions", "[", 
              RowBox[{"contacts", ",", "1"}], "]"}], "[", 
             RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], "]"}]}], 
       "\[IndentingNewLine]", ",", 
       RowBox[{"Style", "[", 
        RowBox[{"\"\<Nejsou definov\[AAcute]ny v\[SHacek]echna data\>\"", ",", 
         RowBox[{"FontFamily", "\[Rule]", "\"\<Helvetica\>\""}], ",", 
         RowBox[{"FontSize", "\[Rule]", "14"}], ",", "Bold", ",", "Red"}], 
        "]"}]}], "]"}], "]"}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", 
   RowBox[{"(*", 
    RowBox[{
    "Vzd\[AAcute]lenost", " ", "mezi", " ", "dv\[EHacek]ma", " ", "body"}], 
    "*)"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"pointdistance", "[", 
     RowBox[{"point1_", ",", "point2_"}], "]"}], ":=", 
    RowBox[{"Sqrt", "[", 
     RowBox[{
      SuperscriptBox[
       RowBox[{"(", 
        RowBox[{
         RowBox[{"point2", "[", 
          RowBox[{"[", "1", "]"}], "]"}], "-", 
         RowBox[{"point1", "[", 
          RowBox[{"[", "1", "]"}], "]"}]}], ")"}], "2"], "+", 
      SuperscriptBox[
       RowBox[{"(", 
        RowBox[{
         RowBox[{"point2", "[", 
          RowBox[{"[", "2", "]"}], "]"}], "-", 
         RowBox[{"point1", "[", 
          RowBox[{"[", "2", "]"}], "]"}]}], ")"}], "2"]}], "]"}]}], 
   "\[IndentingNewLine]", "\[IndentingNewLine]", 
   RowBox[{"(*", 
    RowBox[{
    "Anal\[YAcute]za", " ", "sn\[IAcute]mk\[URing]", " ", "kontaktu"}], 
    "*)"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"imagecontactprocessing", "[", "contactimage_", "]"}], ":=", 
    RowBox[{"{", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"contactradius", "=", "contactradius"}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"contactcenter", "=", "contactcenter"}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"LocatorPane", "[", 
        RowBox[{
         RowBox[{"Dynamic", "[", 
          RowBox[{"{", 
           RowBox[{"contactcenter", ",", "contactradius"}], "}"}], "]"}], ",",
          "\[IndentingNewLine]", 
         RowBox[{"EventHandler", "[", "\[IndentingNewLine]", 
          RowBox[{
           RowBox[{"Show", "[", 
            RowBox[{
             RowBox[{"Graphics", "[", 
              RowBox[{"{", 
               RowBox[{
                RowBox[{"Inset", "[", 
                 RowBox[{"contactimage", ",", 
                  RowBox[{"{", 
                   RowBox[{"0", ",", "0"}], "}"}], ",", 
                  RowBox[{"{", 
                   RowBox[{"Left", ",", "Bottom"}], "}"}], ",", 
                  RowBox[{"ImageDimensions", "[", "contactimage", "]"}]}], 
                 "]"}], ",", 
                RowBox[{"ImageSize", "\[Rule]", "500"}]}], "}"}], "]"}], ",", 
             "\[IndentingNewLine]", 
             RowBox[{"Graphics", "[", 
              RowBox[{"{", "\[IndentingNewLine]", 
               RowBox[{"Red", ",", 
                RowBox[{"Text", "[", 
                 RowBox[{
                  RowBox[{"ImageValue", "[", 
                   RowBox[{
                   "contactimage", ",", "contactcenter", ",", 
                    "\"\<Bit16\>\""}], "]"}], ",", 
                  RowBox[{"{", 
                   RowBox[{"20", ",", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"ImageDimensions", "[", "contactimage", "]"}], 
                    "[", 
                    RowBox[{"[", "2", "]"}], "]"}], "-", "20"}]}], "}"}], ",", 
                  RowBox[{"{", 
                   RowBox[{"Left", ",", "Top"}], "}"}]}], "]"}], ",", 
                "\[IndentingNewLine]", "Red", ",", 
                RowBox[{"Text", "[", 
                 RowBox[{
                  FractionBox[
                   RowBox[{"2", 
                    SuperscriptBox[
                    RowBox[{"(", 
                    RowBox[{
                    RowBox[{"EuclideanDistance", "[", 
                    RowBox[{
                    RowBox[{"contactcenters", "[", 
                    RowBox[{"[", "calibrateimage", "]"}], "]"}], ",", 
                    "contactradius"}], "]"}], 
                    FractionBox[
                    RowBox[{"pixelsize", " ", "pixelbinning"}], 
                    "magnification"], 
                    SuperscriptBox["10", 
                    RowBox[{"-", "3"}]]}], ")"}], "3"], "e"}], 
                   RowBox[{"3", " ", "balldim"}]], ",", 
                  RowBox[{"{", 
                   RowBox[{"20", ",", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"ImageDimensions", "[", "contactimage", "]"}], 
                    "[", 
                    RowBox[{"[", "2", "]"}], "]"}], "-", "40"}]}], "}"}], ",", 
                  RowBox[{"{", 
                   RowBox[{"Left", ",", "Top"}], "}"}]}], "]"}], ",", 
                "\[IndentingNewLine]", "Blue", ",", 
                RowBox[{"Circle", "[", 
                 RowBox[{
                  RowBox[{"Dynamic", "[", 
                   RowBox[{"ImageScaled", "[", 
                    RowBox[{"contactcenter", "/", 
                    RowBox[{"ImageDimensions", "[", "contactimage", "]"}]}], 
                    "]"}], "]"}], ",", 
                  RowBox[{"Dynamic", "[", "cftavcircle", "]"}]}], "]"}], ",", 
                "\[IndentingNewLine]", 
                RowBox[{"Opacity", "[", "0.35", "]"}], ",", 
                RowBox[{"Disk", "[", 
                 RowBox[{
                  RowBox[{"Dynamic", "[", 
                   RowBox[{"ImageScaled", "[", 
                    RowBox[{"contactcenter", "/", 
                    RowBox[{"ImageDimensions", "[", "contactimage", "]"}]}], 
                    "]"}], "]"}], ",", 
                  RowBox[{"Dynamic", "[", "cftavcircle", "]"}]}], "]"}], ",", 
                "\[IndentingNewLine]", 
                RowBox[{"Opacity", "[", "1", "]"}], ",", 
                RowBox[{"Thickness", "[", "0.003", "]"}], ",", "Red", ",", 
                RowBox[{"Circle", "[", 
                 RowBox[{
                  RowBox[{"Dynamic", "[", 
                   RowBox[{"ImageScaled", "[", 
                    RowBox[{"contactcenter", "/", 
                    RowBox[{"ImageDimensions", "[", "contactimage", "]"}]}], 
                    "]"}], "]"}], ",", 
                  RowBox[{"Dynamic", "[", 
                   RowBox[{"pointdistance", "[", 
                    RowBox[{"contactcenter", ",", "contactradius"}], "]"}], 
                   "]"}]}], "]"}], ",", "\[IndentingNewLine]", 
                RowBox[{"Line", "[", 
                 RowBox[{"{", 
                  RowBox[{
                   RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Dynamic", "[", 
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", "0"}], "}"}], 
                   ",", 
                   RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Dynamic", "[", 
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", 
                    RowBox[{
                    RowBox[{"ImageDimensions", "[", "contactimage", "]"}], 
                    "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], "}"}], "]"}], 
                ",", "\[IndentingNewLine]", 
                RowBox[{"Line", "[", 
                 RowBox[{"{", 
                  RowBox[{
                   RowBox[{"{", 
                    RowBox[{"0", ",", 
                    RowBox[{"Dynamic", "[", 
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "2", "]"}], "]"}], "]"}]}], "}"}], ",", 
                   RowBox[{"{", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"ImageDimensions", "[", "contactimage", "]"}], 
                    "[", 
                    RowBox[{"[", "1", "]"}], "]"}], ",", 
                    RowBox[{"Dynamic", "[", 
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "2", "]"}], "]"}], "]"}]}], "}"}]}], "}"}], 
                 "]"}], ",", "\[IndentingNewLine]", "Green", ",", 
                RowBox[{"Circle", "[", 
                 RowBox[{
                  RowBox[{"Dynamic", "[", 
                   RowBox[{"ImageScaled", "[", 
                    RowBox[{"contactcenter", "/", 
                    RowBox[{"ImageDimensions", "[", "contactimage", "]"}]}], 
                    "]"}], "]"}], ",", 
                  RowBox[{"Dynamic", "[", 
                   RowBox[{"hertzcontactarea", " ", 
                    FractionBox[
                    RowBox[{"magnification", " ", 
                    SuperscriptBox["10", "3"]}], 
                    RowBox[{"pixelsize", " ", "pixelbinning", " "}]]}], 
                   "]"}]}], "]"}], ",", "\[IndentingNewLine]", "Cyan", ",", 
                RowBox[{"Circle", "[", 
                 RowBox[{
                  RowBox[{"Dynamic", "[", 
                   RowBox[{"ImageScaled", "[", 
                    RowBox[{"contactcenter", "/", 
                    RowBox[{"ImageDimensions", "[", "contactimage", "]"}]}], 
                    "]"}], "]"}], ",", 
                  RowBox[{"Dynamic", "[", "innercalibcircle", "]"}]}], "]"}], 
                ",", "\[IndentingNewLine]", "Orange", ",", 
                RowBox[{"Circle", "[", 
                 RowBox[{
                  RowBox[{"Dynamic", "[", 
                   RowBox[{"ImageScaled", "[", 
                    RowBox[{"contactcenter", "/", 
                    RowBox[{"ImageDimensions", "[", "contactimage", "]"}]}], 
                    "]"}], "]"}], ",", 
                  RowBox[{"Dynamic", "[", "outercalibcircle", "]"}]}], 
                 "]"}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", 
               "\[IndentingNewLine]", "}"}], "]"}], ",", 
             RowBox[{"PlotRange", "\[Rule]", 
              RowBox[{"{", 
               RowBox[{
                RowBox[{"{", 
                 RowBox[{"0", ",", 
                  RowBox[{
                   RowBox[{"ImageDimensions", "[", "contactimage", "]"}], "[", 
                   RowBox[{"[", "1", "]"}], "]"}]}], "}"}], ",", 
                RowBox[{"{", 
                 RowBox[{"0", ",", 
                  RowBox[{
                   RowBox[{"ImageDimensions", "[", "contactimage", "]"}], "[", 
                   RowBox[{"[", "2", "]"}], "]"}]}], "}"}]}], "}"}]}], ",", 
             RowBox[{"ImageSize", "\[Rule]", "imagesize"}]}], "]"}], 
           "\[IndentingNewLine]", ",", 
           RowBox[{"{", 
            RowBox[{"\"\<RightMouseDragged\>\"", "\[RuleDelayed]", 
             RowBox[{"{", 
              RowBox[{
               RowBox[{"distance", "=", 
                RowBox[{
                 RowBox[{"MousePosition", "[", "\"\<Graphics\>\"", "]"}], "-",
                  "contactcenter"}]}], ";", " ", 
               RowBox[{"contactcenter", "=", 
                RowBox[{"contactcenter", "+", "distance"}]}], ";", 
               RowBox[{"contactradius", "=", 
                RowBox[{"contactradius", "+", "distance"}]}], ";"}], "}"}]}], 
            "}"}], "\[IndentingNewLine]", ",", 
           RowBox[{"PassEventsDown", "\[Rule]", "True"}], ",", 
           RowBox[{"PassEventsUp", "\[Rule]", "True"}]}], "]"}], ",", 
         "\[IndentingNewLine]", 
         RowBox[{"{", 
          RowBox[{"1", ",", 
           RowBox[{
            RowBox[{"ImageDimensions", "[", "contactimage", "]"}], "[", 
            RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], "\[IndentingNewLine]", 
        "]"}], "\[IndentingNewLine]", "\[IndentingNewLine]", 
       RowBox[{"Quiet", "[", 
        RowBox[{"Dynamic", "[", 
         RowBox[{"If", "[", 
          RowBox[{
           RowBox[{"And", "[", 
            RowBox[{
             RowBox[{"And", "[", 
              RowBox[{
               RowBox[{
                RowBox[{"contactcenter", "[", 
                 RowBox[{"[", "1", "]"}], "]"}], ">", "0"}], ",", 
               RowBox[{
                RowBox[{"contactcenter", "[", 
                 RowBox[{"[", "2", "]"}], "]"}], ">", "0"}]}], "]"}], ",", 
             RowBox[{"And", "[", 
              RowBox[{
               RowBox[{
                RowBox[{"contactcenter", "[", 
                 RowBox[{"[", "1", "]"}], "]"}], "<", 
                RowBox[{
                 RowBox[{"ImageDimensions", "[", "contactimage", "]"}], "[", 
                 RowBox[{"[", "1", "]"}], "]"}]}], ",", 
               RowBox[{
                RowBox[{"contactcenter", "[", 
                 RowBox[{"[", "2", "]"}], "]"}], "<", 
                RowBox[{
                 RowBox[{"ImageDimensions", "[", "contactimage", "]"}], "[", 
                 RowBox[{"[", "2", "]"}], "]"}]}]}], "]"}]}], "]"}], ",", 
           "\[IndentingNewLine]", 
           RowBox[{"Show", "[", "\[IndentingNewLine]", 
            RowBox[{
             RowBox[{"ListPlot", "[", "\[IndentingNewLine]", 
              RowBox[{
               RowBox[{"Flatten", "[", " ", 
                RowBox[{"Take", "[", 
                 RowBox[{
                  RowBox[{"ImageData", "[", 
                   RowBox[{"contactimage", ",", "\"\<Bit16\>\""}], "]"}], ",", 
                  RowBox[{"{", 
                   RowBox[{
                    RowBox[{
                    RowBox[{"ImageDimensions", "[", "contactimage", "]"}], 
                    "[", 
                    RowBox[{"[", "2", "]"}], "]"}], "-", 
                    RowBox[{"Round", "[", 
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "2", "]"}], "]"}], "]"}]}], "}"}], ",", 
                  RowBox[{"{", 
                   RowBox[{"1", ",", 
                    RowBox[{
                    RowBox[{"ImageDimensions", "[", "contactimage", "]"}], 
                    "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], "]"}], "]"}], 
               "\[IndentingNewLine]", ",", 
               RowBox[{"PlotRange", "\[Rule]", 
                RowBox[{"{", 
                 RowBox[{"0", ",", "plotrange"}], "}"}]}]}], "]"}], ",", 
             "\[IndentingNewLine]", 
             RowBox[{"Graphics", "[", 
              RowBox[{"{", 
               RowBox[{"Red", ",", "Thick", ",", 
                RowBox[{"Line", "[", 
                 RowBox[{"{", 
                  RowBox[{
                   RowBox[{"{", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"Round", "[", 
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], "-", 
                    RowBox[{"pointdistance", "[", 
                    RowBox[{"contactradius", ",", "contactcenter"}], "]"}]}], 
                    ",", "0"}], "}"}], ",", 
                   RowBox[{"{", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"Round", "[", 
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], "-", 
                    RowBox[{"pointdistance", "[", 
                    RowBox[{"contactradius", ",", "contactcenter"}], "]"}]}], 
                    ",", "65000"}], "}"}]}], "}"}], "]"}], ",", 
                "\[IndentingNewLine]", 
                RowBox[{"Line", "[", 
                 RowBox[{"{", 
                  RowBox[{
                   RowBox[{"{", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"Round", "[", 
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], "+", 
                    RowBox[{"pointdistance", "[", 
                    RowBox[{"contactradius", ",", "contactcenter"}], "]"}]}], 
                    ",", "0"}], "}"}], ",", 
                   RowBox[{"{", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"Round", "[", 
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], "+", 
                    RowBox[{"pointdistance", "[", 
                    RowBox[{"contactradius", ",", "contactcenter"}], "]"}]}], 
                    ",", "65000"}], "}"}]}], "}"}], "]"}], ",", 
                "\[IndentingNewLine]", "Blue", ",", 
                RowBox[{"Line", "[", 
                 RowBox[{"{", 
                  RowBox[{
                   RowBox[{"{", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"Round", "[", 
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], "+", 
                    "cftavcircle"}], ",", "0"}], "}"}], ",", 
                   RowBox[{"{", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"Round", "[", 
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], "+", 
                    "cftavcircle"}], ",", "65000"}], "}"}]}], "}"}], "]"}], 
                ",", 
                RowBox[{"Line", "[", 
                 RowBox[{"{", 
                  RowBox[{
                   RowBox[{"{", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"Round", "[", 
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], "-", 
                    "cftavcircle"}], ",", "0"}], "}"}], ",", 
                   RowBox[{"{", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"Round", "[", 
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], "-", 
                    "cftavcircle"}], ",", "65000"}], "}"}]}], "}"}], "]"}], 
                ",", "\[IndentingNewLine]", 
                RowBox[{"Opacity", "[", "0.35", "]"}], ",", 
                RowBox[{"Rectangle", "[", 
                 RowBox[{
                  RowBox[{"{", 
                   RowBox[{
                    RowBox[{
                    RowBox[{"Round", "[", 
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], "-", 
                    "cftavcircle"}], ",", "0"}], "}"}], ",", 
                  RowBox[{"{", 
                   RowBox[{
                    RowBox[{
                    RowBox[{"Round", "[", 
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], "+", 
                    "cftavcircle"}], ",", "65000"}], "}"}]}], "]"}]}], 
               "\[IndentingNewLine]", "}"}], "]"}], ",", 
             RowBox[{"ImageSize", "\[Rule]", "imagesize"}]}], 
            "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]", ",", 
           RowBox[{"Style", "[", 
            RowBox[{
            "\"\<Centrum kontaktu se nach\[AAcute]z\[IAcute] mimo oblast sn\
\[IAcute]mku\>\"", ",", 
             RowBox[{"FontFamily", "\[Rule]", "\"\<Helvetica\>\""}], ",", 
             RowBox[{"FontSize", "\[Rule]", "14"}], ",", "Bold", ",", "Red"}],
             "]"}]}], "\[IndentingNewLine]", "]"}], "]"}], "]"}]}]}], 
     "\[IndentingNewLine]", "}"}]}], "\[IndentingNewLine]", 
   "\[IndentingNewLine]", 
   RowBox[{"(*", 
    RowBox[{
    "Selekce", " ", "bod\[URing]", " ", "kalibra\[CHacek]n\[IAcute]", " ", 
     "k\[RHacek]ivky"}], "*)"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"selectcalibrationdata", "[", "calibratedimage_", "]"}], ":=", 
    RowBox[{"{", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"positions", "=", 
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{"And", "[", 
          RowBox[{
           RowBox[{"ValueQ", "[", "positions", "]"}], ",", 
           RowBox[{
            SuperscriptBox[
             RowBox[{"(", 
              RowBox[{
               RowBox[{"ImageDimensions", "[", "calibratedimage", "]"}], "[", 
               
               RowBox[{"[", "1", "]"}], "]"}], ")"}], "2"], "\[Equal]", 
            RowBox[{
             RowBox[{"Dimensions", "[", "positions", "]"}], "[", 
             RowBox[{"[", "1", "]"}], "]"}]}]}], "]"}], ",", "positions", ",", 
         RowBox[{"Flatten", "[", " ", 
          RowBox[{
           RowBox[{"Table", "[", 
            RowBox[{
             RowBox[{"{", 
              RowBox[{"j", ",", "i"}], "}"}], ",", 
             RowBox[{"{", 
              RowBox[{"i", ",", "1", ",", 
               RowBox[{
                RowBox[{"ImageDimensions", "[", "calibratedimage", "]"}], "[", 
                RowBox[{"[", "1", "]"}], "]"}], ",", "1"}], "}"}], ",", 
             RowBox[{"{", 
              RowBox[{"j", ",", "1", ",", 
               RowBox[{
                RowBox[{"ImageDimensions", "[", "calibratedimage", "]"}], "[", 
                RowBox[{"[", "1", "]"}], "]"}], ",", "1"}], "}"}]}], "]"}], 
           ",", "1"}], "]"}]}], "]"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"values", "=", 
       RowBox[{"Partition", "[", 
        RowBox[{
         RowBox[{"Flatten", "[", 
          RowBox[{"Reverse", "[", 
           RowBox[{"ImageData", "[", 
            RowBox[{"calibratedimage", ",", "\"\<Bit16\>\""}], "]"}], "]"}], 
          "]"}], ",", "1"}], "]"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"calibdata", "=", 
       RowBox[{"Join", "[", 
        RowBox[{"positions", ",", "values", ",", "2"}], "]"}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"Select", "[", 
       RowBox[{"calibdata", ",", 
        RowBox[{
         RowBox[{"And", "[", 
          RowBox[{
           RowBox[{
            RowBox[{"EuclideanDistance", "[", 
             RowBox[{
              RowBox[{"#", "[", 
               RowBox[{"[", 
                RowBox[{"1", ";;", "2"}], "]"}], "]"}], ",", 
              "contactcenter"}], "]"}], ">", "innercalibcircle"}], ",", 
           RowBox[{
            RowBox[{"EuclideanDistance", "[", 
             RowBox[{
              RowBox[{"#", "[", 
               RowBox[{"[", 
                RowBox[{"1", ";;", "2"}], "]"}], "]"}], ",", 
              "contactcenter"}], "]"}], "<", "outercalibcircle"}]}], "]"}], 
         "&"}]}], "]"}]}], "}"}]}], "\[IndentingNewLine]", 
   "\[IndentingNewLine]", 
   RowBox[{"(*", 
    RowBox[{
    "Pr\[URing]m\[EHacek]rov\[AAcute]n\[IAcute]", " ", "hodnoty", " ", 
     "centr\[AAcute]ln\[IAcute]", " ", "tlou\[SHacek]\[THacek]ky"}], "*)"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"averangecentral", "[", 
     RowBox[{"contactdata_", ",", "areaboundaryradius_", ",", "areacenter_"}],
      "]"}], ":=", 
    RowBox[{"{", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"positions", "=", 
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{"ValueQ", "[", "positions", "]"}], ",", "positions", ",", 
         RowBox[{"Flatten", "[", " ", 
          RowBox[{
           RowBox[{"Table", "[", 
            RowBox[{
             RowBox[{"{", 
              RowBox[{"j", ",", "i"}], "}"}], ",", 
             RowBox[{"{", 
              RowBox[{"i", ",", "1", ",", 
               RowBox[{
                RowBox[{"Dimensions", "[", "contactdata", "]"}], "[", 
                RowBox[{"[", "1", "]"}], "]"}], ",", "1"}], "}"}], ",", 
             RowBox[{"{", 
              RowBox[{"j", ",", "1", ",", 
               RowBox[{
                RowBox[{"Dimensions", "[", "contactdata", "]"}], "[", 
                RowBox[{"[", "1", "]"}], "]"}], ",", "1"}], "}"}]}], "]"}], 
           ",", "1"}], "]"}]}], "]"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"Mean", "[", 
       RowBox[{"Pick", "[", 
        RowBox[{
         RowBox[{"Flatten", "[", "contactdata", "]"}], ",", 
         RowBox[{"UnitStep", "[", 
          RowBox[{
           RowBox[{"areaboundaryradius", "^", "2"}], "-", 
           RowBox[{"Total", "[", 
            RowBox[{
             RowBox[{"(", 
              RowBox[{
               RowBox[{"Transpose", "[", "positions", "]"}], "-", 
               "areacenter"}], ")"}], "^", "2"}], "]"}]}], "]"}], ",", "1"}], 
        "]"}], "]"}]}], "\[IndentingNewLine]", "}"}]}], "\[IndentingNewLine]",
    "\[IndentingNewLine]", 
   RowBox[{"(*", 
    RowBox[{
    "Body", " ", "pro", " ", "vytvo\[RHacek]en\[IAcute]", " ", "os", " ", 
     "grafu"}], "*)"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"ticks", "[", 
     RowBox[{"min_", ",", "max_", ",", "label_"}], "]"}], ":=", 
    RowBox[{
     RowBox[{
      RowBox[{"{", 
       RowBox[{
        RowBox[{"If", "[", 
         RowBox[{
          RowBox[{"#", "<", "1"}], ",", 
          RowBox[{"N", "@", "#"}], ",", "#"}], "]"}], ",", 
        RowBox[{"If", "[", 
         RowBox[{
          RowBox[{
           RowBox[{"Count", "[", 
            RowBox[{"label", ",", 
             RowBox[{"If", "[", 
              RowBox[{
               RowBox[{"#", "<", "1"}], ",", 
               RowBox[{"N", "@", "#"}], ",", "#"}], "]"}]}], "]"}], ">", 
           "0"}], ",", 
          RowBox[{"ToString", "[", 
           RowBox[{"If", "[", 
            RowBox[{
             RowBox[{"#", "<", "1"}], ",", 
             RowBox[{"N", "@", "#"}], ",", "#"}], "]"}], "]"}], ",", 
          "\"\<\>\""}], "]"}], ",", 
        RowBox[{"{", 
         RowBox[{
          RowBox[{"If", "[", 
           RowBox[{
            RowBox[{
             RowBox[{"Count", "[", 
              RowBox[{"label", ",", 
               RowBox[{"If", "[", 
                RowBox[{
                 RowBox[{"#", "<", "1"}], ",", 
                 RowBox[{"N", "@", "#"}], ",", "#"}], "]"}]}], "]"}], ">", 
             "0"}], ",", "0.015", ",", "0.005"}], "]"}], ",", "0"}], "}"}]}], 
       "}"}], "&"}], "/@", 
     RowBox[{"Flatten", "[", 
      RowBox[{"Table", "[", 
       RowBox[{
        RowBox[{
         RowBox[{"Range", "[", 
          RowBox[{"1", ",", "10"}], "]"}], 
         SuperscriptBox["10", "i"]}], ",", 
        RowBox[{"{", 
         RowBox[{"i", ",", "min", ",", "max"}], "}"}]}], "]"}], "]"}]}]}], 
   "\[IndentingNewLine]", "\n", 
   RowBox[{"(*", 
    RowBox[{
    "Nastaven\[IAcute]", " ", "slo\[ZHacek]ky", " ", "s", " ", "daty", " ", 
     "a", " ", "v\[YAcute]po\[CHacek]etn\[IAcute]m", " ", "programem"}], 
    "*)"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"SetDirectory", "[", 
     RowBox[{"NotebookDirectory", "[", "]"}], "]"}], ";"}], "\n", 
   RowBox[{"(*", 
    RowBox[{"Import", " ", "soubor\[URing]"}], "*)"}], "\[IndentingNewLine]", 
   
   RowBox[{
    RowBox[{"data", "=", 
     RowBox[{"Import", "[", 
      RowBox[{"\"\<*.dat\>\"", ",", "\"\<UnsignedInteger16\>\""}], "]"}]}], 
    ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"filenames", "=", 
     RowBox[{
      RowBox[{
       RowBox[{"StringDrop", "[", 
        RowBox[{"#", ",", 
         RowBox[{"-", "4"}]}], "]"}], "&"}], "/@", 
      RowBox[{"FileNames", "[", "\"\<*.dat\>\"", "]"}]}]}], ";"}], "\n", 
   "\[IndentingNewLine]", 
   RowBox[{"(*", "Prom\[EHacek]nn\[EAcute]", "*)"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"staticdata", "=", 
     RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"backgrounddata", "=", 
     RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"contactdata", "=", 
     RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"datatype", "=", "3"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"datatypes", "=", 
     RowBox[{"Range", "[", 
      RowBox[{
       RowBox[{"Dimensions", "[", "data", "]"}], "[", 
       RowBox[{"[", "1", "]"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", 
   
   RowBox[{
    RowBox[{"staticnames", "=", 
     RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"backgroundnames", "=", 
     RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"contactnames", "=", 
     RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"usedbackground", "=", "Null"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"shownimages", "=", 
     RowBox[{"{", "1", "}"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"contactcenter", "=", 
     RowBox[{"{", 
      RowBox[{"1", ",", "1"}], "}"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"contactradius", "=", 
     RowBox[{"{", 
      RowBox[{"2", ",", "2"}], "}"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"distance", "=", "Null"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"contactcenters", "=", 
     RowBox[{"Range", "[", 
      RowBox[{
       RowBox[{"Dimensions", "[", "data", "]"}], "[", 
       RowBox[{"[", "1", "]"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", 
   
   RowBox[{
    RowBox[{"imageconvolution", "=", "False"}], ";"}], "\[IndentingNewLine]", 
   
   RowBox[{
    RowBox[{"e", "=", "Null"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"hertzcontactarea", "=", "Null"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"convolutionmatrix", "=", 
     RowBox[{"{", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"1", ",", "1", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "2", ",", "1"}], "}"}], ",", 
       RowBox[{"{", 
        RowBox[{"1", ",", "1", ",", "1"}], "}"}]}], "}"}]}], ";"}], 
   "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"innercalibcircle", "=", "10"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"outercalibcircle", "=", "20"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"cftavcircle", "=", "20"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"showngraphs", "=", "1"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"shownprofiles", "=", 
     RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"profilesaverange", "=", "10"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"pixelbinning", "=", " ", "Null"}], ";"}], "\[IndentingNewLine]", 
   
   RowBox[{
    RowBox[{"pixelsize", "=", "6.5"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"magnification", "=", "Null"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"contactbegin", "=", "Null"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"contactend", "=", "Null"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"imagesizex", "=", "2560"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"imagesizey", "=", "2160"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"\[Nu]disc", "=", "0.206"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"\[Nu]ball", "=", "0.3"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"edisc", "=", "80000"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"eball", "=", "210000"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"ws", "=", "Null"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"conll", "=", "0"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"conul", "=", "65536"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"l1", "=", "1"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"mv", "=", "1"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"cstatic", "=", "Null"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"balldim", "=", "Null"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"\[Eta]vis", "=", "Null"}], ";"}], "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"\[Alpha]pv", "=", "Null"}], ";"}], 
   "\[IndentingNewLine]"}]}]], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.6315915604127913`*^9, 3.631591589937313*^9}, {
   3.631828202542179*^9, 3.631828207260027*^9}, {3.632032577103767*^9, 
   3.632032649843862*^9}, {3.632038696777122*^9, 3.63203876422775*^9}, {
   3.632038837580179*^9, 3.632038865701008*^9}, {3.6320394170097637`*^9, 
   3.6320394338973627`*^9}, 3.632039482259448*^9, 3.6321342159022827`*^9, {
   3.63214641334551*^9, 3.6321464153347063`*^9}, {3.632146617198729*^9, 
   3.632146644829693*^9}, {3.632146682047928*^9, 3.632146851330021*^9}, {
   3.632147159255248*^9, 3.632147316949559*^9}, {3.632147723621483*^9, 
   3.632147724052319*^9}, {3.632147845611827*^9, 3.6321478531577883`*^9}, {
   3.632147960990958*^9, 3.632148013175989*^9}, {3.63216352230193*^9, 
   3.632163653878149*^9}, 3.6324656875563583`*^9, {3.6325140849255743`*^9, 
   3.632514136641964*^9}, 3.632514287548843*^9, {3.632544012736092*^9, 
   3.632544041667121*^9}, {3.632545213378183*^9, 3.632545234885159*^9}, {
   3.6325454127894*^9, 3.632545418791059*^9}, {3.632545490927198*^9, 
   3.632545502165369*^9}, {3.6325455617427797`*^9, 3.632545565122086*^9}, {
   3.632546741143742*^9, 3.632546821856941*^9}, {3.632546967803928*^9, 
   3.632546982047021*^9}, {3.632985545364711*^9, 3.632985555451159*^9}, {
   3.632985587242782*^9, 3.632985663375313*^9}, {3.6329857559058743`*^9, 
   3.632985756664654*^9}, {3.633026517104336*^9, 3.6330265248556557`*^9}, {
   3.633026559816361*^9, 3.6330265859921017`*^9}, {3.633026653056775*^9, 
   3.6330266971882563`*^9}, {3.6330269300485287`*^9, 3.633026946179978*^9}, {
   3.633029181297841*^9, 3.6330292036769257`*^9}, {3.633065653977347*^9, 
   3.6330656570328293`*^9}, 3.633067538357387*^9, {3.633067611028632*^9, 
   3.6330676127495413`*^9}, 3.633068134221266*^9, 3.6330681825300913`*^9, 
   3.63306829391078*^9, 3.6330683735248737`*^9, 3.6330766300162354`*^9, {
   3.633084739237803*^9, 3.63308475512217*^9}, {3.633085211921232*^9, 
   3.6330852176580763`*^9}, {3.633154501511962*^9, 3.6331545021461554`*^9}, 
   3.633163024263647*^9, 3.633173015617907*^9, 3.633184107599388*^9, {
   3.63318572522392*^9, 3.633185733428388*^9}, 3.6331970236447487`*^9, 
   3.6335895964576683`*^9, {3.633695607537942*^9, 3.633695670870104*^9}, {
   3.633695728089711*^9, 3.633695734906411*^9}, {3.6336958862952747`*^9, 
   3.6336958972815247`*^9}, 3.63369784740765*^9, 3.6336978785207872`*^9, {
   3.633697933909987*^9, 3.6336980078085423`*^9}, {3.6336980948561077`*^9, 
   3.6336981375168667`*^9}, {3.633698204193716*^9, 3.6336982137576237`*^9}, 
   3.6336983214997883`*^9, {3.633698437725546*^9, 3.633698476769183*^9}, {
   3.6336985183710833`*^9, 3.633698545015313*^9}, {3.6336986468330393`*^9, 
   3.633698652674868*^9}, {3.6343231209421883`*^9, 3.634323147390072*^9}, {
   3.6347566763993397`*^9, 3.634756759506201*^9}, {3.634758512529788*^9, 
   3.634758542840743*^9}, {3.635047791095909*^9, 3.635047794064062*^9}, {
   3.6354490203879747`*^9, 3.635449033800597*^9}, {3.635481842589587*^9, 
   3.63548184502075*^9}, {3.635482747781415*^9, 3.635482776913692*^9}, 
   3.635482832446887*^9, {3.635482875915917*^9, 3.635482957549616*^9}, {
   3.635483579562697*^9, 3.635483598546093*^9}, {3.63548365239183*^9, 
   3.6354836658223248`*^9}, {3.635484229800736*^9, 3.6354842369900637`*^9}, 
   3.635484293206355*^9, 3.6356665177643223`*^9, {3.635750674638167*^9, 
   3.635750725923036*^9}, {3.635751885516347*^9, 3.635751913484713*^9}, {
   3.6357522908689337`*^9, 3.63575232848526*^9}, {3.635752413427909*^9, 
   3.635752414586845*^9}, {3.635752616832336*^9, 3.635752626371092*^9}, {
   3.635752656380488*^9, 3.63575268692352*^9}, {3.635753007851548*^9, 
   3.6357530623045673`*^9}, {3.635754186563689*^9, 3.635754213415105*^9}, {
   3.6357544173794518`*^9, 3.6357544581335583`*^9}, {3.635754689684182*^9, 
   3.635754827169969*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", 
   RowBox[{
    RowBox[{
    "T\[RHacek]\[IAcute]d\[EHacek]n\[IAcute]", " ", "dat", " ", "na", " ", 
     "statick\[EAcute]", " ", "kontakty"}], ",", " ", 
    RowBox[{"pozad\[IAcute]", " ", "a", " ", "kontakty"}], ",", " ", 
    RowBox[{"definice", " ", "podm\[IAcute]nek"}]}], "*)"}], 
  "\[IndentingNewLine]", 
  RowBox[{"Dynamic", "[", 
   RowBox[{"panel1", "=", 
    RowBox[{"Panel", "[", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Grid", "[", 
       RowBox[{
        RowBox[{"{", 
         RowBox[{
          RowBox[{"{", 
           RowBox[{
            RowBox[{"Button", "[", 
             RowBox[{"\"\<Save data\>\"", ",", 
              RowBox[{"DumpSave", "[", 
               RowBox[{
                RowBox[{
                 RowBox[{"SystemDialogInput", "[", "\"\<FileSave\>\"", "]"}], 
                 "<>", "\"\<.mx\>\""}], ",", "\"\<Global`\>\""}], "]"}], ",", 
              
              RowBox[{"Method", "\[Rule]", "\"\<Queued\>\""}]}], "]"}], ",", 
            RowBox[{"Button", "[", 
             RowBox[{"\"\<Load data\>\"", ",", 
              RowBox[{"Get", "[", 
               RowBox[{"SystemDialogInput", "[", "\"\<FileOpen\>\"", "]"}], 
               "]"}], ",", 
              RowBox[{"Method", "\[Rule]", "\"\<Queued\>\""}]}], "]"}]}], 
           "}"}], ",", 
          RowBox[{"{", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{"Grid", "[", 
             RowBox[{"{", "\[IndentingNewLine]", 
              RowBox[{
               RowBox[{"{", 
                RowBox[{"\"\<Image horizontal size\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "imagesizex", "]"}], "]"}], ",", 
                 "\"\<[Pixel]\>\""}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{"\"\<Image vertical size\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "imagesizey", "]"}], "]"}], ",", 
                 "\"\<[Pixel]\>\""}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{"\"\<Pixel binning\>\"", ",", " ", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "pixelbinning", "]"}], "]"}], ",", 
                 "\"\<[-]\>\""}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{"\"\<Pixel size\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "pixelsize", "]"}], "]"}], ",", 
                 "\"\<[\[Mu]m]\>\""}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{"\"\<Objective magnification\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "magnification", "]"}], "]"}], ",", 
                 "\"\<[-]\>\""}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{"\"\<Contact begining\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "contactbegin", "]"}], "]"}], ",", 
                 "\"\<[Pixel]\>\""}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{"\"\<Contact ending\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "contactend", "]"}], "]"}], ",", 
                 "\"\<[Pixel]\>\""}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{"\"\<Static load\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "ws", "]"}], "]"}], ",", 
                 "\"\<[N]\>\""}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{"\"\<Poisson's ratio of disc\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "\[Nu]disc", "]"}], "]"}], ",", 
                 "\"\<[-]\>\""}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{"\"\<Poisson's ratio of ball\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "\[Nu]ball", "]"}], "]"}], ",", 
                 "\"\<[-]\>\""}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{"\"\<Modulus of elasticity of disc\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "edisc", "]"}], "]"}], ",", 
                 "\"\<[Mpa]\>\""}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{"\"\<Modulus of elasticity of ball\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "eball", "]"}], "]"}], ",", 
                 "\"\<[Mpa]\>\""}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{"\"\<Contrast upper level\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "conul", "]"}], "]"}], ",", 
                 "\"\<[-]\>\""}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{"\"\<Contrast lover level\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "conll", "]"}], "]"}], ",", 
                 "\"\<[-]\>\""}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{"\"\<Ball Radius\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "balldim", "]"}], "]"}], ",", 
                 "\"\<[mm]\>\""}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{"\"\<Dynamic viscosity of lubricant\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "\[Eta]vis", "]"}], "]"}], ",", 
                 "\"\<[pa s]\>\""}], "}"}], ",", 
               RowBox[{"{", 
                RowBox[{"\"\<Pressure-viscosity coeficient\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "\[Alpha]pv", "]"}], "]"}], ",", 
                 "\"\<[-]\>\""}], "}"}]}], "}"}], "]"}], ",", 
            "\[IndentingNewLine]", "\[IndentingNewLine]", 
            RowBox[{"Column", "[", 
             RowBox[{"Flatten", "[", "\[IndentingNewLine]", 
              RowBox[{
               RowBox[{"Table", "[", 
                RowBox[{
                 RowBox[{"Row", "[", 
                  RowBox[{"{", "\[IndentingNewLine]", 
                   RowBox[{
                    RowBox[{"DynamicModule", "[", 
                    RowBox[{
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"datatype", "=", "3"}], ",", 
                    RowBox[{"i", "=", "i"}]}], "}"}], ",", 
                    RowBox[{"Dynamic", "[", "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"datatypes", "[", 
                    RowBox[{"[", "i", "]"}], "]"}], "=", "datatype"}], ";", 
                    "\[IndentingNewLine]", 
                    RowBox[{"PopupMenu", "[", 
                    RowBox[{
                    RowBox[{"Dynamic", "[", "datatype", "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"1", "\[Rule]", "\"\<Static\>\""}], ",", 
                    RowBox[{"2", "\[Rule]", "\"\<Background\>\""}], ",", 
                    RowBox[{"3", "\[Rule]", "\"\<Contact\>\""}]}], "}"}]}], 
                    "]"}]}], "]"}]}], "]"}], ",", "\"\<   Soubor:   \>\"", 
                    ",", 
                    RowBox[{"filenames", "[", 
                    RowBox[{"[", "i", "]"}], "]"}]}], "}"}], "]"}], ",", 
                 RowBox[{"{", 
                  RowBox[{"i", ",", "1", ",", 
                   RowBox[{
                    RowBox[{"Dimensions", "[", "data", "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}], ",", "1"}], "}"}]}], 
                "]"}], "\[IndentingNewLine]", ",", "1"}], "]"}], 
             "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", 
            RowBox[{"Column", "[", 
             RowBox[{"{", 
              RowBox[{
               RowBox[{"\"\<Calibration images: \>\"", 
                RowBox[{"Dynamic", "[", 
                 RowBox[{
                  RowBox[{"Dimensions", "[", "staticdata", "]"}], "[", 
                  RowBox[{"[", "1", "]"}], "]"}], "]"}]}], ",", 
               "\[IndentingNewLine]", 
               RowBox[{"\"\<Background images: \>\"", 
                RowBox[{"Dynamic", "[", 
                 RowBox[{
                  RowBox[{"Dimensions", "[", "backgrounddata", "]"}], "[", 
                  RowBox[{"[", "1", "]"}], "]"}], "]"}]}], ",", 
               "\[IndentingNewLine]", 
               RowBox[{"\"\<Contact images: \>\"", 
                RowBox[{"Dynamic", "[", 
                 RowBox[{
                  RowBox[{"Dimensions", "[", "contactdata", "]"}], "[", 
                  RowBox[{"[", "1", "]"}], "]"}], "]"}]}], ",", 
               "\[IndentingNewLine]", 
               RowBox[{"\"\<Total images: \>\"", 
                RowBox[{"Dynamic", "[", 
                 RowBox[{
                  RowBox[{"Dimensions", "[", "data", "]"}], "[", 
                  RowBox[{"[", "1", "]"}], "]"}], "]"}]}], ",", 
               "\[IndentingNewLine]", 
               RowBox[{"Button", "[", 
                RowBox[{"\"\<Asign data type\>\"", ",", "\[IndentingNewLine]", 
                 RowBox[{
                  RowBox[{"staticdata", "=", 
                   RowBox[{
                    RowBox[{
                    RowBox[{"data", "[", 
                    RowBox[{"[", "#", "]"}], "]"}], "&"}], "/@", 
                    RowBox[{"Pick", "[", 
                    RowBox[{
                    RowBox[{"Range", "[", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", "data", "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", "datatypes", 
                    ",", "1"}], "]"}]}]}], ";", "\[IndentingNewLine]", 
                  RowBox[{"backgrounddata", "=", 
                   RowBox[{
                    RowBox[{
                    RowBox[{"data", "[", 
                    RowBox[{"[", "#", "]"}], "]"}], "&"}], "/@", 
                    RowBox[{"Pick", "[", 
                    RowBox[{
                    RowBox[{"Range", "[", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", "data", "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", "datatypes", 
                    ",", "2"}], "]"}]}]}], ";", "\[IndentingNewLine]", 
                  RowBox[{"contactdata", "=", 
                   RowBox[{
                    RowBox[{
                    RowBox[{"data", "[", 
                    RowBox[{"[", "#", "]"}], "]"}], "&"}], "/@", 
                    RowBox[{"Pick", "[", 
                    RowBox[{
                    RowBox[{"Range", "[", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", "data", "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", "datatypes", 
                    ",", "3"}], "]"}]}]}], ";", "\[IndentingNewLine]", 
                  RowBox[{"staticnames", "=", 
                   RowBox[{
                    RowBox[{
                    RowBox[{"filenames", "[", 
                    RowBox[{"[", "#", "]"}], "]"}], "&"}], "/@", 
                    RowBox[{"Pick", "[", 
                    RowBox[{
                    RowBox[{"Range", "[", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", "data", "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", "datatypes", 
                    ",", "1"}], "]"}]}]}], ";", "\[IndentingNewLine]", 
                  RowBox[{"backgroundnames", "=", 
                   RowBox[{
                    RowBox[{
                    RowBox[{"filenames", "[", 
                    RowBox[{"[", "#", "]"}], "]"}], "&"}], "/@", 
                    RowBox[{"Pick", "[", 
                    RowBox[{
                    RowBox[{"Range", "[", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", "data", "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", "datatypes", 
                    ",", "2"}], "]"}]}]}], ";", "\[IndentingNewLine]", 
                  RowBox[{"contactnames", "=", 
                   RowBox[{
                    RowBox[{
                    RowBox[{"filenames", "[", 
                    RowBox[{"[", "#", "]"}], "]"}], "&"}], "/@", 
                    RowBox[{"Pick", "[", 
                    RowBox[{
                    RowBox[{"Range", "[", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", "data", "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", "datatypes", 
                    ",", "3"}], "]"}]}]}], ";"}]}], "]"}], ",", 
               "\[IndentingNewLine]", "\"\<Normalization image:\>\"", ",", 
               "\[IndentingNewLine]", 
               RowBox[{"Dynamic", "[", 
                RowBox[{"PopupMenu", "[", 
                 RowBox[{
                  RowBox[{"Dynamic", "[", "usedbackground", "]"}], ",", 
                  RowBox[{
                   RowBox[{
                    RowBox[{"(", 
                    RowBox[{"#1", "\[Rule]", "#2"}], ")"}], "&"}], "@@@", 
                   RowBox[{"Transpose", "[", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Range", "[", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", "backgroundnames", "]"}], "[", 
                    
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", 
                    "backgroundnames"}], "}"}], "]"}]}]}], "]"}], "]"}], ",", 
               "\[IndentingNewLine]", 
               RowBox[{"Button", "[", 
                RowBox[{"\"\<Start\>\"", ",", 
                 RowBox[{
                  RowBox[{"normalizedcontacts", "=", 
                   RowBox[{"imagenormalization", "[", 
                    RowBox[{
                    "contactdata", ",", "backgrounddata", ",", 
                    "usedbackground"}], "]"}]}], ";", "\[IndentingNewLine]", 
                  RowBox[{"normalizedstatics", "=", 
                   RowBox[{"imagenormalization", "[", 
                    RowBox[{
                    "staticdata", ",", "backgrounddata", ",", 
                    "usedbackground"}], "]"}]}]}], ",", 
                 RowBox[{"Method", "\[Rule]", "\"\<Queued\>\""}]}], "]"}], 
               ",", "\[IndentingNewLine]", 
               RowBox[{"Button", "[", 
                RowBox[{"\"\<Interupt\>\"", ",", 
                 RowBox[{"Interrupt", "[", "]"}]}], "]"}], ",", 
               "\[IndentingNewLine]", 
               RowBox[{"Button", "[", 
                RowBox[{"\"\<Abort\>\"", ",", 
                 RowBox[{"Abort", "[", "]"}]}], "]"}]}], 
              "\[IndentingNewLine]", "}"}], "]"}]}], "\[IndentingNewLine]", 
           "}"}]}], "}"}], ",", 
        RowBox[{"Alignment", "\[Rule]", 
         RowBox[{"{", 
          RowBox[{"Left", ",", "Top"}], "}"}]}]}], "]"}], ",", 
      RowBox[{"Background", "\[Rule]", 
       RowBox[{"RGBColor", "[", 
        RowBox[{"0.85", ",", "0.85", ",", "0.85"}], "]"}]}]}], "]"}]}], 
   "]"}]}]], "Input",
 InitializationCell->True,
 CellChangeTimes->{{3.631802455630188*^9, 3.6318024587432404`*^9}, {
   3.631802708526175*^9, 3.6318027914307632`*^9}, {3.631802837178698*^9, 
   3.6318029283483267`*^9}, {3.6318030928363733`*^9, 3.631803100509316*^9}, {
   3.631803155477085*^9, 3.631803163448501*^9}, {3.631803204935255*^9, 
   3.631803322659219*^9}, {3.6318034167911777`*^9, 3.631803438677013*^9}, {
   3.6318035104104967`*^9, 3.631803521105391*^9}, {3.631803555030278*^9, 
   3.631803610320466*^9}, {3.631803661101213*^9, 3.631803661193062*^9}, {
   3.6318036982841663`*^9, 3.6318037733614063`*^9}, {3.631804103002688*^9, 
   3.631804143555182*^9}, {3.631804488620455*^9, 3.631804499551505*^9}, {
   3.631804546959461*^9, 3.6318045824873877`*^9}, {3.6318047725524054`*^9, 
   3.631804787728383*^9}, {3.631804820535776*^9, 3.631804829070827*^9}, {
   3.6318048652783546`*^9, 3.631804866742405*^9}, {3.631804909016552*^9, 
   3.6318050931662807`*^9}, {3.631805155572077*^9, 3.631805167161356*^9}, {
   3.6318052175096073`*^9, 3.6318053151817703`*^9}, {3.63180542196525*^9, 
   3.6318055066719103`*^9}, {3.631805550838641*^9, 3.631805571621704*^9}, {
   3.631805675858314*^9, 3.6318057206174192`*^9}, {3.631805853247569*^9, 
   3.631805860980569*^9}, {3.631805903968191*^9, 3.6318060041207*^9}, {
   3.631806351477459*^9, 3.6318065691180143`*^9}, {3.631813631385591*^9, 
   3.6318136728948402`*^9}, {3.631813707508609*^9, 3.631813709482463*^9}, {
   3.631813771132189*^9, 3.6318139128162317`*^9}, {3.631814003314807*^9, 
   3.631814057361174*^9}, {3.63181409581488*^9, 3.6318140984759808`*^9}, {
   3.63181421254663*^9, 3.631814216794408*^9}, {3.6318142508814583`*^9, 
   3.631814265099242*^9}, {3.6318142961483727`*^9, 3.631814322458617*^9}, {
   3.6318143548605967`*^9, 3.6318143774244757`*^9}, {3.631814446183483*^9, 
   3.6318144742900467`*^9}, {3.6318145095724373`*^9, 3.631814537799876*^9}, {
   3.631815010706778*^9, 3.631815108195195*^9}, {3.631821253178405*^9, 
   3.6318212814455357`*^9}, 3.6318213168742123`*^9, {3.631821350534891*^9, 
   3.63182150899231*^9}, {3.631822032805148*^9, 3.631822064308476*^9}, {
   3.631822151075967*^9, 3.631822204599433*^9}, {3.631822234775531*^9, 
   3.631822332808585*^9}, {3.6318223676635933`*^9, 3.631822443242235*^9}, {
   3.631822515989293*^9, 3.6318225974589252`*^9}, {3.631822630702183*^9, 
   3.63182263239005*^9}, {3.631822688244812*^9, 3.6318228056439257`*^9}, {
   3.631822945166706*^9, 3.631823077322645*^9}, {3.631823176921768*^9, 
   3.6318234134049997`*^9}, {3.631823453870236*^9, 3.631823462874782*^9}, {
   3.631823528275195*^9, 3.631823532410152*^9}, {3.63182357753857*^9, 
   3.631823641628768*^9}, {3.6318238348372583`*^9, 3.631823857461967*^9}, {
   3.6318239523282948`*^9, 3.6318240239041758`*^9}, 3.631824217851533*^9, {
   3.631824677186481*^9, 3.631824691868188*^9}, {3.631824728233966*^9, 
   3.631824816049163*^9}, 3.631824859906165*^9, {3.631824918713687*^9, 
   3.631824936320969*^9}, 3.6318249870018177`*^9, {3.6318250312115297`*^9, 
   3.631825050975984*^9}, {3.631825106894752*^9, 3.631825113088119*^9}, {
   3.631825143287238*^9, 3.631825156710359*^9}, {3.6318251963601513`*^9, 
   3.631825243442357*^9}, {3.631825327026016*^9, 3.631825359675866*^9}, 
   3.6318255758507233`*^9, 3.63182562598425*^9, {3.631825661643805*^9, 
   3.631825667636084*^9}, {3.631825699662348*^9, 3.631825726445648*^9}, {
   3.6318258506439943`*^9, 3.6318258516111317`*^9}, {3.6318259159142437`*^9, 
   3.631825959905665*^9}, {3.6318260550788393`*^9, 3.631826081769741*^9}, {
   3.631826160595438*^9, 3.63182623694811*^9}, {3.6318263000091333`*^9, 
   3.6318263498252487`*^9}, {3.631826393728191*^9, 3.631826399638239*^9}, {
   3.6318264544478607`*^9, 3.6318265204645147`*^9}, {3.6318265655287952`*^9, 
   3.631826572505549*^9}, {3.631826614113679*^9, 3.6318266199697227`*^9}, {
   3.6318266625497828`*^9, 3.63182670067869*^9}, {3.631826744812331*^9, 
   3.631826862256809*^9}, {3.6318269193557653`*^9, 3.631826984505891*^9}, {
   3.6318270225029583`*^9, 3.6318270544337387`*^9}, {3.631827086687098*^9, 
   3.631827175537726*^9}, {3.6318272595802803`*^9, 3.631827275748448*^9}, {
   3.631827370254765*^9, 3.6318277131760397`*^9}, {3.631827752335244*^9, 
   3.6318280502517033`*^9}, {3.631828093365653*^9, 3.631828143062044*^9}, 
   3.631828186502063*^9, {3.631828241825642*^9, 3.631828271521185*^9}, 
   3.632030421310977*^9, {3.6320307164394007`*^9, 3.632030782875258*^9}, {
   3.6320309665717297`*^9, 3.6320310154961643`*^9}, {3.6320310954780407`*^9, 
   3.632031099036368*^9}, {3.632031224282071*^9, 3.632031233652685*^9}, {
   3.6320313404144573`*^9, 3.6320313519783373`*^9}, {3.632031384157283*^9, 
   3.6320314109503183`*^9}, {3.632031486629343*^9, 3.632031627639076*^9}, {
   3.632031669478414*^9, 3.632031743283876*^9}, {3.6320318174841948`*^9, 
   3.63203184616121*^9}, {3.63203205030835*^9, 3.632032120271023*^9}, {
   3.632032186782316*^9, 3.632032261828499*^9}, {3.6320327465794163`*^9, 
   3.632032776556768*^9}, {3.63203327627244*^9, 3.6320333650640717`*^9}, {
   3.632033397278348*^9, 3.632033415582613*^9}, {3.6320336745176907`*^9, 
   3.6320336764033213`*^9}, {3.632034048366747*^9, 3.6320340800059*^9}, 
   3.6320341278485107`*^9, 3.632034163765682*^9, {3.632034195840987*^9, 
   3.632034198017963*^9}, {3.6320343779474087`*^9, 3.632034522660446*^9}, {
   3.632038946624237*^9, 3.632038952767482*^9}, {3.632048246262013*^9, 
   3.632048265475265*^9}, {3.632048626236573*^9, 3.632048626518752*^9}, {
   3.632048729388508*^9, 3.6320487453534927`*^9}, {3.632048808849996*^9, 
   3.632048961761868*^9}, {3.632048997103589*^9, 3.632049036195693*^9}, {
   3.632671042512113*^9, 3.632671117401243*^9}, {3.632671157256158*^9, 
   3.632671164283987*^9}, 3.632671218854368*^9, {3.63267128277979*^9, 
   3.632671360986146*^9}, {3.632671392332741*^9, 3.632671437137315*^9}, {
   3.632986973702001*^9, 3.632987000245323*^9}, 3.633683718523549*^9, 
   3.6336859459819603`*^9, {3.633697149729396*^9, 3.633697303804888*^9}, 
   3.633697933910328*^9, {3.6336997424752274`*^9, 3.633699751961412*^9}, {
   3.633699859229163*^9, 3.633699873133205*^9}, {3.633699903314011*^9, 
   3.633699905194268*^9}, {3.635482310534761*^9, 3.635482311614801*^9}, 
   3.635482368956298*^9, {3.6354824787935047`*^9, 3.635482515785478*^9}, {
   3.635482592964838*^9, 3.6354826049086723`*^9}, {3.6354831372969313`*^9, 
   3.635483139526682*^9}, {3.635669802093837*^9, 3.6356698077076197`*^9}}],

Cell[BoxData[
 DynamicBox[ToBoxes[$CellContext`panel1 = Panel[
     Grid[{{
        Button["Save data", 
         DumpSave[
          StringJoin[
           SystemDialogInput["FileSave"], ".mx"], "Global`"], Method -> 
         "Queued"], 
        Button["Load data", 
         Get[
          SystemDialogInput["FileOpen"]], Method -> "Queued"]}, {
        Grid[{{"Image horizontal size", 
           InputField[
            Dynamic[$CellContext`imagesizex]], "[Pixel]"}, {
          "Image vertical size", 
           InputField[
            Dynamic[$CellContext`imagesizey]], "[Pixel]"}, {"Pixel binning", 
           InputField[
            Dynamic[$CellContext`pixelbinning]], "[-]"}, {"Pixel size", 
           InputField[
            Dynamic[$CellContext`pixelsize]], "[\[Mu]m]"}, {
          "Objective magnification", 
           InputField[
            Dynamic[$CellContext`magnification]], "[-]"}, {"Contact begining", 
           InputField[
            Dynamic[$CellContext`contactbegin]], "[Pixel]"}, {
          "Contact ending", 
           InputField[
            Dynamic[$CellContext`contactend]], "[Pixel]"}, {"Static load", 
           InputField[
            Dynamic[$CellContext`ws]], "[N]"}, {"Poisson's ratio of disc", 
           InputField[
            Dynamic[$CellContext`\[Nu]disc]], "[-]"}, {
          "Poisson's ratio of ball", 
           InputField[
            Dynamic[$CellContext`\[Nu]ball]], "[-]"}, {
          "Modulus of elasticity of disc", 
           InputField[
            Dynamic[$CellContext`edisc]], "[Mpa]"}, {
          "Modulus of elasticity of ball", 
           InputField[
            Dynamic[$CellContext`eball]], "[Mpa]"}, {"Contrast upper level", 
           InputField[
            Dynamic[$CellContext`conul]], "[-]"}, {"Contrast lover level", 
           InputField[
            Dynamic[$CellContext`conll]], "[-]"}, {"Ball Radius", 
           InputField[
            Dynamic[$CellContext`balldim]], "[mm]"}, {
          "Dynamic viscosity of lubricant", 
           InputField[
            Dynamic[$CellContext`\[Eta]vis]], "[pa s]"}, {
          "Pressure-viscosity coeficient", 
           InputField[
            Dynamic[$CellContext`\[Alpha]pv]], "[-]"}}], 
        Column[
         Flatten[
          Table[
           Row[{
             
             DynamicModule[{$CellContext`datatype = 
               3, $CellContext`i = $CellContext`i}, 
              Dynamic[
              Part[$CellContext`datatypes, $CellContext`i] = \
$CellContext`datatype; PopupMenu[
                 Dynamic[$CellContext`datatype], {
                 1 -> "Static", 2 -> "Background", 3 -> "Contact"}]]], 
             "   Soubor:   ", 
             Part[$CellContext`filenames, $CellContext`i]}], {$CellContext`i, 
            1, 
            Part[
             Dimensions[$CellContext`data], 1], 1}], 1]], 
        Column[{"Calibration images: " Dynamic[
            Part[
             Dimensions[$CellContext`staticdata], 1]], "Background images: " 
          Dynamic[
            Part[
             Dimensions[$CellContext`backgrounddata], 1]], "Contact images: " 
          Dynamic[
            Part[
             Dimensions[$CellContext`contactdata], 1]], "Total images: " 
          Dynamic[
            Part[
             Dimensions[$CellContext`data], 1]], 
          Button[
          "Asign data type", $CellContext`staticdata = 
            Map[Part[$CellContext`data, #]& , 
              Pick[
               Range[
                Part[
                 Dimensions[$CellContext`data], 1]], $CellContext`datatypes, 
               1]]; $CellContext`backgrounddata = 
            Map[Part[$CellContext`data, #]& , 
              Pick[
               Range[
                Part[
                 Dimensions[$CellContext`data], 1]], $CellContext`datatypes, 
               2]]; $CellContext`contactdata = 
            Map[Part[$CellContext`data, #]& , 
              Pick[
               Range[
                Part[
                 Dimensions[$CellContext`data], 1]], $CellContext`datatypes, 
               3]]; $CellContext`staticnames = 
            Map[Part[$CellContext`filenames, #]& , 
              Pick[
               Range[
                Part[
                 Dimensions[$CellContext`data], 1]], $CellContext`datatypes, 
               1]]; $CellContext`backgroundnames = 
            Map[Part[$CellContext`filenames, #]& , 
              Pick[
               Range[
                Part[
                 Dimensions[$CellContext`data], 1]], $CellContext`datatypes, 
               2]]; $CellContext`contactnames = 
            Map[Part[$CellContext`filenames, #]& , 
              Pick[
               Range[
                Part[
                 Dimensions[$CellContext`data], 1]], $CellContext`datatypes, 
               3]]; Null], "Normalization image:", 
          Dynamic[
           PopupMenu[
            Dynamic[$CellContext`usedbackground], 
            Apply[# -> #2& , 
             Transpose[{
               Range[
                Part[
                 Dimensions[$CellContext`backgroundnames], 
                 1]], $CellContext`backgroundnames}], {1}]]], 
          Button[
          "Start", $CellContext`normalizedcontacts = \
$CellContext`imagenormalization[$CellContext`contactdata, \
$CellContext`backgrounddata, $CellContext`usedbackground]; \
$CellContext`normalizedstatics = \
$CellContext`imagenormalization[$CellContext`staticdata, \
$CellContext`backgrounddata, $CellContext`usedbackground], Method -> 
           "Queued"], 
          Button["Interupt", 
           Interrupt[]], 
          Button["Abort", 
           Abort[]]}]}}, Alignment -> {Left, Top}], Background -> 
     RGBColor[0.85, 0.85, 0.85]], StandardForm],
  ImageSizeCache->{750., {233., 239.}}]], "Output",
 CellChangeTimes->{
  3.6349008400861893`*^9, 3.634922602265688*^9, 3.635046601844592*^9, 
   3.6350475819867287`*^9, 3.635139661284268*^9, 3.635404440949916*^9, 
   3.635478388231965*^9, 3.635481526555028*^9, 3.635482370773079*^9, 
   3.63548260760878*^9, 3.635483141120791*^9, 3.6356660494756308`*^9, 
   3.635666101337475*^9, {3.635669809060852*^9, 3.6356698188609953`*^9}, 
   3.635677016028515*^9, 3.635677102873906*^9, 3.635690253957672*^9, {
   3.6357040677828407`*^9, 3.635704081109948*^9}, {3.635760823428853*^9, 
   3.635760832456141*^9}, {3.641059005282879*^9, 3.6410590262521544`*^9}, 
   3.641104495373753*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"\[IndentingNewLine]", 
  RowBox[{"Quiet", "[", 
   RowBox[{"Dynamic", "[", 
    RowBox[{
     RowBox[{"e", ":=", 
      FractionBox["1", 
       RowBox[{
        FractionBox["1", "2"], 
        RowBox[{"(", 
         RowBox[{
          FractionBox[
           RowBox[{"1", "-", 
            SuperscriptBox["\[Nu]disc", "2"]}], "edisc"], "+", 
          FractionBox[
           RowBox[{"1", "-", 
            SuperscriptBox["\[Nu]ball", "2"]}], "eball"]}], ")"}]}]]}], ";", 
     RowBox[{"(*", "Mpa", "*)"}], "\[IndentingNewLine]", 
     RowBox[{"k", "=", "1"}], ";", "\[IndentingNewLine]", 
     RowBox[{"R", "=", "balldim"}], ";", "\[IndentingNewLine]", 
     RowBox[{"a", "=", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"EuclideanDistance", "[", 
         RowBox[{
          RowBox[{"contactcenters", "[", 
           RowBox[{"[", "calibrateimage", "]"}], "]"}], ",", 
          "contactradius"}], "]"}], 
        FractionBox[
         RowBox[{"pixelsize", " ", "pixelbinning"}], "magnification"], 
        SuperscriptBox["10", 
         RowBox[{"-", "3"}]]}], ")"}]}], ";", 
     RowBox[{"(*", "mm", "*)"}], "\[IndentingNewLine]", 
     RowBox[{"hertzcontactarea", "=", 
      SuperscriptBox[
       RowBox[{"(", 
        FractionBox[
         RowBox[{" ", 
          RowBox[{"3", "ws", " ", "balldim"}]}], 
         RowBox[{"2", "e"}]], ")"}], 
       FractionBox["1", "3"]]}], ";", 
     RowBox[{"(*", "mm", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", 
     RowBox[{"pmax", ":=", 
      FractionBox[
       RowBox[{"3", "ws"}], 
       RowBox[{" ", 
        RowBox[{"2", "\[Pi]", " ", 
         SuperscriptBox["a", "2"]}]}]]}], ";", 
     RowBox[{"(*", "mm", "*)"}], "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"H", "[", "r_", "]"}], ":=", 
      RowBox[{
       FractionBox[
        RowBox[{"a", " ", "pmax", " "}], "e"], 
       RowBox[{"(", 
        RowBox[{
         RowBox[{
          RowBox[{"-", 
           RowBox[{"(", 
            RowBox[{"2", "-", 
             FractionBox[
              SuperscriptBox["r", "2"], 
              SuperscriptBox["a", "2"]]}], ")"}]}], 
          RowBox[{"ArcCos", "[", 
           FractionBox["a", "r"], "]"}]}], "+", 
         SuperscriptBox[
          RowBox[{"(", 
           RowBox[{
            FractionBox[
             SuperscriptBox["r", "2"], 
             SuperscriptBox["a", "2"]], "-", "1"}], ")"}], 
          FractionBox["1", "2"]]}], " ", ")"}]}]}], " ", ";", 
     RowBox[{"(*", "mm", "*)"}], "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"U", "[", "Uin_", "]"}], ":=", 
      FractionBox[
       RowBox[{"Uin", " ", "\[Eta]vis"}], 
       RowBox[{"e", " ", 
        SuperscriptBox["10", "6"], "R"}]]}], " ", ";", 
     RowBox[{"(*", 
      RowBox[{
      "Bezrozm\[EHacek]rn\[YAcute]", " ", "parametr", " ", "Rychlosti"}], 
      "*)"}], "\[IndentingNewLine]", 
     RowBox[{"W", "=", 
      FractionBox["ws", 
       RowBox[{"e", " ", 
        SuperscriptBox["R", 
         RowBox[{"2", "\[IndentingNewLine]"}]]}]]}], ";", 
     RowBox[{"(*", 
      RowBox[{
      "Bezrozm\[EHacek]rn\[YAcute]", " ", "parametr", " ", 
       "zat\[IAcute]\[ZHacek]en\[IAcute]"}], "*)"}], "\[IndentingNewLine]", 
     RowBox[{"G", "=", 
      RowBox[{"e", " ", "\[Alpha]pv", " ", 
       SuperscriptBox["10", 
        RowBox[{"-", "3"}]]}]}], ";", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Hcehd", "[", "Uin_", "]"}], ":=", 
      RowBox[{"2.69", 
       SuperscriptBox[
        RowBox[{"U", "[", "Uin", "]"}], "0.67"], 
       SuperscriptBox["G", "0.53"], 
       SuperscriptBox["W", 
        RowBox[{"-", "0.067"}]], 
       RowBox[{"(", 
        RowBox[{"1", "-", 
         RowBox[{"0.61", " ", 
          SuperscriptBox["\[ExponentialE]", 
           RowBox[{
            RowBox[{"-", "0.73"}], "k"}]]}]}], ")"}], "R", " ", 
       SuperscriptBox["10", "3"]}]}], ";", 
     RowBox[{"(*", 
      RowBox[{"Hammrock", "-", 
       RowBox[{"Dowson", " ", "EHD"}]}], "*)"}], "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Hc", "[", "Uin_", "]"}], ":=", 
      RowBox[{"7.32", 
       RowBox[{"(", 
        RowBox[{"1", "-", 
         RowBox[{"0.72", 
          SuperscriptBox["\[ExponentialE]", 
           RowBox[{
            RowBox[{"-", "0.28"}], " ", "k"}]]}]}], ")"}], " ", 
       SuperscriptBox[
        RowBox[{
         RowBox[{"U", "[", "Uin", "]"}], " "}], "0.64"], 
       SuperscriptBox["W", 
        RowBox[{"-", "0.22"}]], "R", " ", 
       SuperscriptBox["10", "3"]}]}], ";", 
     RowBox[{"(*", 
      RowBox[{
       RowBox[{
        RowBox[{
         RowBox[{"Hammrock", "&"}], "Dowson", " ", "I"}], "-", "EHD"}], ",", 
       "\[Micro]m"}], "*)"}], "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"hmr", "[", "Uin_", "]"}], ":=", 
      RowBox[{"2.8", 
       SuperscriptBox["R", "0.67"], 
       SuperscriptBox[
        RowBox[{"(", 
         RowBox[{"Uin", " ", "\[Eta]vis"}], ")"}], "0.6"], 
       SuperscriptBox["ws", 
        RowBox[{"-", "0.13"}]], 
       SuperscriptBox["e", 
        RowBox[{"-", "0.47"}]]}]}], ";", 
     RowBox[{"(*", "Hook", "*)"}], "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"hms", "[", "Uin_", "]"}], ":=", 
      RowBox[{"8.9", 
       SuperscriptBox["R", "0.92"], 
       SuperscriptBox[
        RowBox[{"(", 
         RowBox[{"Uin", " ", "\[Eta]vis"}], ")"}], "0.75"], 
       SuperscriptBox["ws", 
        RowBox[{"-", "0.33"}]], 
       SuperscriptBox["e", 
        RowBox[{"-", "0.42"}]]}]}], ";", 
     RowBox[{"(*", "Hook", "*)"}], "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Hcn", "[", "Uin_", "]"}], ":=", 
      RowBox[{"Ci", " ", 
       SuperscriptBox[
        RowBox[{"M", "[", "Uin", "]"}], 
        FractionBox[
         RowBox[{"-", "2"}], "15"]]}]}], ";", 
     RowBox[{"(*", 
      RowBox[{
      "Centr\[AAcute]ln\[IAcute]", " ", "tlou\[SHacek]\[THacek]ka", " ", 
       "Nijenbanning"}], "*)"}], "\[IndentingNewLine]", 
     RowBox[{"Ci", "=", 
      RowBox[{"3.18", 
       SuperscriptBox[
        RowBox[{"(", 
         RowBox[{"1", "+", 
          RowBox[{"0.006", " ", 
           RowBox[{"Log", "[", "1", "]"}]}], "+", 
          RowBox[{"0.63", " ", 
           SuperscriptBox["1", 
            FractionBox["4", "7"]]}]}], ")"}], 
        FractionBox[
         RowBox[{"-", "14"}], "25"]], 
       SuperscriptBox["1", 
        FractionBox[
         RowBox[{"-", "1"}], "15"]]}]}], ";", 
     RowBox[{"(*", "*)"}], "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"M", "[", "Uin_", "]"}], ":=", 
      RowBox[{"W", " ", 
       SuperscriptBox[
        RowBox[{"U", "[", "Uin", "]"}], 
        FractionBox[
         RowBox[{"-", "3"}], "4"]]}]}]}], 
    RowBox[{"(*", 
     RowBox[{"Bezrozm\[EHacek]rn\[YAcute]", " ", "Moes", " ", "parametr"}], 
     "*)"}], "\[IndentingNewLine]", "]"}], "]"}]}]], "Input",
 CellChangeTimes->{{3.632382362289151*^9, 3.6323824049689837`*^9}, {
   3.6323824589929857`*^9, 3.632382490820807*^9}, {3.6323825216735888`*^9, 
   3.6323825328981524`*^9}, {3.632382567505845*^9, 3.632382659463582*^9}, {
   3.632382853382893*^9, 3.6323830572803926`*^9}, {3.632383433820078*^9, 
   3.632383467224943*^9}, {3.6323835066873217`*^9, 3.632383701974716*^9}, {
   3.6323840558198442`*^9, 3.632384097266012*^9}, {3.632384151226474*^9, 
   3.632384155582302*^9}, {3.632384192389738*^9, 3.632384193846656*^9}, {
   3.632384300666553*^9, 3.632384304050215*^9}, {3.632422473268077*^9, 
   3.6324224818471193`*^9}, {3.632481868219387*^9, 3.632481897182294*^9}, {
   3.632514363085135*^9, 3.632514364450921*^9}, {3.633060155086645*^9, 
   3.6330601606144533`*^9}, {3.633060192553295*^9, 3.633060202422009*^9}, {
   3.633060338989709*^9, 3.6330603705018044`*^9}, {3.633061381179448*^9, 
   3.633061397209609*^9}, {3.6330636095918913`*^9, 3.633063614234704*^9}, {
   3.633063781123427*^9, 3.633063802822206*^9}, {3.633063917745504*^9, 
   3.633064018161676*^9}, {3.63307824271224*^9, 3.633078278043367*^9}, {
   3.6330787282010717`*^9, 3.633078830151434*^9}, {3.633078868968459*^9, 
   3.633078910084321*^9}, {3.633149158547872*^9, 3.633149178502244*^9}, {
   3.6342889626623898`*^9, 3.63428896556763*^9}, 3.6342932678032084`*^9, {
   3.634293454147476*^9, 3.6342934771306953`*^9}, {3.634293661452389*^9, 
   3.634293690873473*^9}, 3.634293810965561*^9, {3.6342941085892057`*^9, 
   3.6342941338527517`*^9}, 3.634294171262339*^9, 3.634294413377037*^9, 
   3.634355085365193*^9, 3.634355847306407*^9, {3.634556405563101*^9, 
   3.6345564065122643`*^9}, {3.634557016601259*^9, 3.6345570434023848`*^9}, {
   3.634900907576982*^9, 3.634900908752923*^9}, {3.635047765414084*^9, 
   3.6350477661492853`*^9}, {3.635482654731907*^9, 3.635482661098914*^9}, {
   3.635666492863489*^9, 3.635666496727726*^9}, 3.635669848668735*^9, {
   3.6356815826489*^9, 3.635681677434428*^9}, 3.635681721024403*^9, {
   3.635681991355502*^9, 3.635682008960557*^9}, 3.635690869190983*^9, {
   3.635706115274673*^9, 3.635706118600999*^9}}],

Cell[BoxData[
 DynamicBox[
  ToBoxes[$CellContext`e := 
    1/((1/2) ((1 - $CellContext`\[Nu]disc^2)/$CellContext`edisc + (
        1 - $CellContext`\[Nu]ball^2)/$CellContext`eball)); $CellContext`k = 
    1; $CellContext`R = $CellContext`balldim; $CellContext`a = 
    EuclideanDistance[
       Part[$CellContext`contactcenters, $CellContext`calibrateimage], \
$CellContext`contactradius] ($CellContext`pixelsize \
$CellContext`pixelbinning/$CellContext`magnification) 
     10^(-3); $CellContext`hertzcontactarea = (
      3 $CellContext`ws $CellContext`balldim/(2 $CellContext`e))^(1/
      3); $CellContext`pmax := 
    3 $CellContext`ws/(2 Pi $CellContext`a^2); $CellContext`H[
      Pattern[$CellContext`r, 
       Blank[]]] := ($CellContext`a $CellContext`pmax/$CellContext`e) ((-(
         2 - $CellContext`r^2/$CellContext`a^2)) 
       ArcCos[$CellContext`a/$CellContext`r] + \
($CellContext`r^2/$CellContext`a^2 - 1)^(1/2)); $CellContext`U[
      Pattern[$CellContext`Uin, 
       Blank[]]] := $CellContext`Uin $CellContext`\[Eta]vis/($CellContext`e 
     10^6 $CellContext`R); $CellContext`W = $CellContext`ws/($CellContext`e \
$CellContext`R^2); $CellContext`G = $CellContext`e $CellContext`\[Alpha]pv 
     10^(-3); $CellContext`Hcehd[
      Pattern[$CellContext`Uin, 
       Blank[]]] := 
    2.69 $CellContext`U[$CellContext`Uin]^0.67 $CellContext`G^0.53 \
$CellContext`W^(-0.067) (1 - 0.61 E^((-0.73) $CellContext`k)) $CellContext`R 
     10^3; $CellContext`Hc[
      Pattern[$CellContext`Uin, 
       Blank[]]] := 
    7.32 (1 - 0.72 
      E^((-0.28) $CellContext`k)) $CellContext`U[$CellContext`Uin]^0.64 \
$CellContext`W^(-0.22) $CellContext`R 10^3; $CellContext`hmr[
      Pattern[$CellContext`Uin, 
       Blank[]]] := 
    2.8 $CellContext`R^0.67 ($CellContext`Uin $CellContext`\[Eta]vis)^0.6 \
$CellContext`ws^(-0.13) $CellContext`e^(-0.47); $CellContext`hms[
      Pattern[$CellContext`Uin, 
       Blank[]]] := 
    8.9 $CellContext`R^0.92 ($CellContext`Uin $CellContext`\[Eta]vis)^0.75 \
$CellContext`ws^(-0.33) $CellContext`e^(-0.42); $CellContext`Hcn[
      Pattern[$CellContext`Uin, 
       Blank[]]] := $CellContext`Ci $CellContext`M[$CellContext`Uin]^((-2)/
       15); $CellContext`Ci = 
    3.18 (1 + 0.006 Log[1] + 0.63 1^(4/7))^((-14)/25) 
     1^((-1)/15); $CellContext`M[
      Pattern[$CellContext`Uin, 
       Blank[]]] := $CellContext`W $CellContext`U[$CellContext`Uin]^((-3)/4), 
   StandardForm],
  ImageSizeCache->{31., {0., 9.}}]], "Output",
 CellChangeTimes->{
  3.6354826805829697`*^9, 3.635666387459942*^9, 3.635677125594153*^9, {
   3.63568166000373*^9, 3.635681682395863*^9}, 3.6356817222766*^9, 
   3.6356820464375057`*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"7.32", 
  RowBox[{"(", 
   RowBox[{"1", "-", 
    RowBox[{"0.72", 
     SuperscriptBox["\[ExponentialE]", 
      RowBox[{
       RowBox[{"-", "0.28"}], " ", "1"}]]}]}], ")"}]}]], "Input",
 CellChangeTimes->{{3.6356818870538282`*^9, 3.63568192764425*^9}, 
   3.635681962188343*^9, 3.635682016916231*^9}],

Cell[BoxData["3.3367173690317453`"], "Output",
 CellChangeTimes->{3.635681928309454*^9, 3.635681963712756*^9, 
  3.635682017177352*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"panel2", "=", 
  RowBox[{"Panel", "[", "\[IndentingNewLine]", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"Grid", "[", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{
        RowBox[{"{", 
         RowBox[{"Column", "[", 
          RowBox[{"{", 
           RowBox[{"\"\<Show images:\>\"", ",", "\[IndentingNewLine]", 
            RowBox[{"TogglerBar", "[", 
             RowBox[{
              RowBox[{"Dynamic", "[", "shownimages", "]"}], ",", 
              RowBox[{
               RowBox[{
                RowBox[{"(", 
                 RowBox[{"#1", "\[Rule]", "#2"}], ")"}], "&"}], "@@@", 
               RowBox[{"Transpose", "[", 
                RowBox[{"{", 
                 RowBox[{
                  RowBox[{"Range", "[", 
                   RowBox[{
                    RowBox[{"Dimensions", "[", 
                    RowBox[{"Join", "[", 
                    RowBox[{"staticnames", ",", "contactnames"}], "]"}], 
                    "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", 
                  RowBox[{"Join", "[", 
                   RowBox[{"staticnames", ",", "contactnames"}], "]"}]}], 
                 "}"}], "]"}]}]}], "]"}]}], "\[IndentingNewLine]", "}"}], 
          "]"}], "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", 
        RowBox[{"{", 
         RowBox[{"Row", "[", 
          RowBox[{
           RowBox[{"{", 
            RowBox[{
             RowBox[{"Column", "[", 
              RowBox[{
               RowBox[{"{", "\[IndentingNewLine]", 
                RowBox[{
                 RowBox[{"Button", "[", 
                  RowBox[{"\"\<Show All\>\"", ",", 
                   RowBox[{"shownimages", "=", 
                    RowBox[{"Range", "[", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", 
                    RowBox[{"Join", "[", 
                    RowBox[{"staticnames", ",", "contactnames"}], "]"}], 
                    "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}]}]}], "]"}], ",", 
                 "\[IndentingNewLine]", 
                 RowBox[{"Button", "[", 
                  RowBox[{"\"\<Hide All\>\"", ",", 
                   RowBox[{"shownimages", "=", 
                    RowBox[{"{", "}"}]}]}], "]"}], ",", "\[IndentingNewLine]", 
                 RowBox[{"Button", "[", 
                  RowBox[{"\"\<Convolution\>\"", ",", 
                   RowBox[{"If", "[", 
                    RowBox[{
                    RowBox[{"imageconvolution", "\[Equal]", "False"}], ",", 
                    RowBox[{"imageconvolution", "=", "True"}], " ", ",", 
                    RowBox[{"imageconvolution", "=", "False"}]}], "]"}], ",", 
                   
                   RowBox[{"Appearance", "\[Rule]", 
                    RowBox[{"Dynamic", "[", 
                    RowBox[{"If", "[", 
                    RowBox[{
                    "imageconvolution", ",", "\"\<Pressed\>\"", ",", 
                    "\"\<DialogBox\>\""}], "]"}], "]"}]}]}], "]"}], ",", 
                 "\[IndentingNewLine]", "\"\<Convolution matrix:\>\"", ",", 
                 "\[IndentingNewLine]", 
                 RowBox[{"Grid", "[", 
                  RowBox[{"Table", "[", 
                   RowBox[{
                    RowBox[{"With", "[", 
                    RowBox[{
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"i", "=", "i"}], ",", 
                    RowBox[{"j", "=", "j"}]}], "}"}], ",", 
                    RowBox[{"InputField", "[", 
                    RowBox[{
                    RowBox[{"Dynamic", "[", 
                    RowBox[{"convolutionmatrix", "[", 
                    RowBox[{"[", 
                    RowBox[{"i", ",", "j"}], "]"}], "]"}], "]"}], ",", 
                    RowBox[{"FieldSize", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{"1.7", ",", " ", "1"}], "}"}]}]}], "]"}]}], "]"}],
                     ",", 
                    RowBox[{"{", 
                    RowBox[{"i", ",", "3"}], "}"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"j", ",", "3"}], "}"}]}], "]"}], "]"}], ",", 
                 "\[IndentingNewLine]", "\"\<Contact radius trim:\>\"", ",", 
                 "\[IndentingNewLine]", 
                 RowBox[{"Row", "[", 
                  RowBox[{"{", "\[IndentingNewLine]", 
                   RowBox[{
                    RowBox[{"Button", "[", 
                    RowBox[{"\"\<+\>\"", ",", 
                    RowBox[{"Dynamic", "[", 
                    RowBox[{"contactradius", "=", 
                    RowBox[{"contactradius", "+", "0.7"}]}], "]"}]}], "]"}], 
                    ",", "\[IndentingNewLine]", 
                    RowBox[{"Button", "[", 
                    RowBox[{"\"\<-\>\"", ",", 
                    RowBox[{"Dynamic", "[", 
                    RowBox[{"contactradius", "=", 
                    RowBox[{"contactradius", "-", "0.7"}]}], "]"}]}], "]"}]}],
                    "\[IndentingNewLine]", "}"}], "]"}], ",", 
                 "\[IndentingNewLine]", "\"\<Contact center trim:\>\"", ",", 
                 "\[IndentingNewLine]", 
                 RowBox[{"Column", "[", 
                  RowBox[{
                   RowBox[{"{", "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"Button", "[", 
                    RowBox[{"\"\<\[Wedge]\>\"", ",", 
                    RowBox[{"Dynamic", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "2", "]"}], "]"}], "=", 
                    RowBox[{
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "2", "]"}], "]"}], "+", "1"}]}], ";", 
                    "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"contactradius", "[", 
                    RowBox[{"[", "2", "]"}], "]"}], "=", 
                    RowBox[{
                    RowBox[{"contactradius", "[", 
                    RowBox[{"[", "2", "]"}], "]"}], "+", "1"}]}], ";"}], 
                    "]"}], ",", 
                    RowBox[{"ImageSize", "\[Rule]", "50"}]}], "]"}], ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"Row", "[", 
                    RowBox[{"{", "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"Button", "[", 
                    RowBox[{"\"\<<\>\"", ",", 
                    RowBox[{"Dynamic", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "=", 
                    RowBox[{
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "-", "1"}]}], ";", 
                    "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"contactradius", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "=", 
                    RowBox[{
                    RowBox[{"contactradius", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "-", "1"}]}], ";"}], 
                    "]"}]}], "]"}], ",", "\[IndentingNewLine]", 
                    RowBox[{"Button", "[", 
                    RowBox[{"\"\<>\>\"", ",", 
                    RowBox[{"Dynamic", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "=", 
                    RowBox[{
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "+", "1"}]}], ";", 
                    "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"contactradius", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "=", 
                    RowBox[{
                    RowBox[{"contactradius", "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "+", "1"}]}], ";"}], 
                    "]"}]}], "]"}]}], "\[IndentingNewLine]", "}"}], "]"}], 
                    ",", "\[IndentingNewLine]", 
                    RowBox[{"Button", "[", 
                    RowBox[{"\"\<\[Vee]\>\"", ",", 
                    RowBox[{"Dynamic", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "2", "]"}], "]"}], "=", 
                    RowBox[{
                    RowBox[{"contactcenter", "[", 
                    RowBox[{"[", "2", "]"}], "]"}], "-", "1"}]}], ";", 
                    "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"contactradius", "[", 
                    RowBox[{"[", "2", "]"}], "]"}], "=", 
                    RowBox[{
                    RowBox[{"contactradius", "[", 
                    RowBox[{"[", "2", "]"}], "]"}], "-", "1"}]}], ";"}], 
                    "]"}], ",", 
                    RowBox[{"ImageSize", "\[Rule]", "50"}]}], "]"}]}], 
                    "\[IndentingNewLine]", "}"}], ",", 
                   RowBox[{"Alignment", "\[Rule]", "Center"}]}], "]"}], ",", 
                 "\[IndentingNewLine]", 
                 RowBox[{"Panel", "[", 
                  RowBox[{
                   RowBox[{"Column", "[", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"\"\<Image size: \>\"", 
                    RowBox[{"Dynamic", "[", "imagesize", "]"}]}], ",", 
                    RowBox[{"Slider", "[", 
                    RowBox[{
                    RowBox[{"Dynamic", "[", "imagesize", "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"100", ",", "1000", ",", "1"}], "}"}], ",", 
                    RowBox[{"ImageSize", "\[Rule]", "147"}]}], "]"}], ",", 
                    RowBox[{"\"\<Plot range: \>\"", 
                    RowBox[{"Dynamic", "[", "plotrange", "]"}]}], ",", 
                    RowBox[{"Slider", "[", 
                    RowBox[{
                    RowBox[{"Dynamic", "[", "plotrange", "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"0.1", ",", "65000", ",", "1"}], "}"}], ",", 
                    RowBox[{"ImageSize", "\[Rule]", "147"}]}], "]"}], ",", 
                    "\"\<Inner clibration boundary\>\"", ",", 
                    RowBox[{"\"\<Radius: \>\"", 
                    RowBox[{"Dynamic", "[", "innercalibcircle", "]"}]}], ",", 
                    
                    RowBox[{"Slider", "[", 
                    RowBox[{
                    RowBox[{"Dynamic", "[", "innercalibcircle", "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"1", ",", 
                    RowBox[{
                    RowBox[{"Max", "[", 
                    RowBox[{"{", 
                    RowBox[{"imagesizex", ",", "imagesizex"}], "}"}], "]"}], 
                    "/", 
                    RowBox[{"(", 
                    RowBox[{"2", "pixelbinning"}], ")"}]}], ",", "1"}], "}"}],
                     ",", 
                    RowBox[{"ImageSize", "\[Rule]", "147"}]}], "]"}], ",", 
                    "\"\<Outer calibration boundary\>\"", ",", 
                    RowBox[{"\"\<Radius: \>\"", 
                    RowBox[{"Dynamic", "[", "outercalibcircle", "]"}]}], ",", 
                    
                    RowBox[{"Slider", "[", 
                    RowBox[{
                    RowBox[{"Dynamic", "[", "outercalibcircle", "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"1", ",", 
                    RowBox[{
                    RowBox[{"Max", "[", 
                    RowBox[{"{", 
                    RowBox[{"imagesizex", ",", "imagesizex"}], "}"}], "]"}], 
                    "/", 
                    RowBox[{"(", 
                    RowBox[{"2", "pixelbinning"}], ")"}]}], ",", "1"}], "}"}],
                     ",", 
                    RowBox[{"ImageSize", "\[Rule]", "147"}]}], "]"}], ",", 
                    "\"\<Central thickness boundary\>\"", ",", 
                    RowBox[{"\"\<Radius: \>\"", 
                    RowBox[{"Dynamic", "[", "cftavcircle", "]"}]}], ",", 
                    RowBox[{"Slider", "[", 
                    RowBox[{
                    RowBox[{"Dynamic", "[", "cftavcircle", "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"1", ",", 
                    RowBox[{
                    RowBox[{"Max", "[", 
                    RowBox[{"{", 
                    RowBox[{"imagesizex", ",", "imagesizex"}], "}"}], "]"}], 
                    "/", 
                    RowBox[{"(", 
                    RowBox[{"4", "pixelbinning"}], ")"}]}], ",", "1"}], "}"}],
                     ",", 
                    RowBox[{"ImageSize", "\[Rule]", "147"}]}], "]"}]}], "}"}],
                     "]"}], ",", 
                   RowBox[{"Background", "\[Rule]", "White"}]}], "]"}], ",", 
                 "\[IndentingNewLine]", 
                 RowBox[{"Button", "[", 
                  RowBox[{"\"\<Save all from static\>\"", ",", 
                   RowBox[{
                    RowBox[{"contactcenters", "[", 
                    RowBox[{"[", 
                    RowBox[{"1", ";;", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", "contactcenters", "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], "]"}], "]"}], "=", 
                    "contactcenter"}]}], "]"}], ",", "\[IndentingNewLine]", 
                 RowBox[{"Dynamic", "[", 
                  RowBox[{"PopupMenu", "[", 
                   RowBox[{
                    RowBox[{"Dynamic", "[", "calibrateimage", "]"}], ",", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"(", 
                    RowBox[{"#1", "\[Rule]", "#2"}], ")"}], "&"}], "@@@", 
                    RowBox[{"Transpose", "[", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Range", "[", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", 
                    RowBox[{"Join", "[", 
                    RowBox[{"staticnames", ",", "contactnames"}], "]"}], 
                    "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", 
                    RowBox[{"Join", "[", 
                    RowBox[{"staticnames", ",", "contactnames"}], "]"}]}], 
                    "}"}], "]"}]}]}], "]"}], "]"}], ",", 
                 "\[IndentingNewLine]", 
                 RowBox[{"Button", "[", 
                  RowBox[{"\"\<Select calibration points\>\"", ",", 
                   RowBox[{"calibrateintensities", "=", 
                    RowBox[{"Flatten", "[", 
                    RowBox[{
                    RowBox[{"selectcalibrationdata", "[", 
                    RowBox[{
                    RowBox[{"Join", "[", 
                    RowBox[{"normalizedstatics", ",", "normalizedcontacts"}], 
                    "]"}], "[", 
                    RowBox[{"[", "calibrateimage", "]"}], "]"}], "]"}], ",", 
                    "1"}], "]"}]}], ",", 
                   RowBox[{"Method", "\[Rule]", "\"\<Queued\>\""}]}], "]"}], 
                 ",", "\[IndentingNewLine]", 
                 RowBox[{"Column", "[", 
                  RowBox[{
                   RowBox[{"{", "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"Dynamic", "[", 
                    RowBox[{"Button", "[", 
                    RowBox[{
                    "\"\<Solve area calibration\>\"", ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"a", "=", 
                    RowBox[{
                    RowBox[{"EuclideanDistance", "[", 
                    RowBox[{
                    RowBox[{"contactcenters", "[", 
                    RowBox[{"[", "calibrateimage", "]"}], "]"}], ",", 
                    "contactradius"}], "]"}], 
                    FractionBox[
                    RowBox[{"pixelsize", " ", "pixelbinning"}], 
                    "magnification"], 
                    SuperscriptBox["10", 
                    RowBox[{"-", "3"}]]}]}], ";", 
                    RowBox[{"intensitydistances", "=", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"(", 
                    RowBox[{
                    RowBox[{"EuclideanDistance", "[", 
                    RowBox[{
                    RowBox[{"#", "[", 
                    RowBox[{"[", 
                    RowBox[{"1", ";;", "2"}], "]"}], "]"}], ",", 
                    RowBox[{"contactcenters", "[", 
                    RowBox[{"[", "calibrateimage", "]"}], "]"}]}], "]"}], 
                    FractionBox[
                    RowBox[{"pixelsize", " ", "pixelbinning"}], 
                    "magnification"], 
                    SuperscriptBox["10", 
                    RowBox[{"-", "3"}]]}], ")"}], "&"}], "/@", 
                    "calibrateintensities"}]}], ";", "\[IndentingNewLine]", 
                    RowBox[{"hertzthickneses", "=", 
                    RowBox[{
                    RowBox[{"H", "[", "intensitydistances", "]"}], 
                    SuperscriptBox["10", "3"]}]}], ";", "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"Calibratefunction", "[", "x_", "]"}], "=", 
                    RowBox[{"Normal", "[", 
                    RowBox[{"LinearModelFit", "[", 
                    RowBox[{
                    RowBox[{"Join", "[", 
                    RowBox[{
                    RowBox[{"Partition", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    RowBox[{"#", "[", 
                    RowBox[{"[", "3", "]"}], "]"}], "&"}], "/@", 
                    "calibrateintensities"}], ",", "1"}], "]"}], ",", 
                    RowBox[{"Partition", "[", 
                    RowBox[{"hertzthickneses", ",", "1"}], "]"}], ",", "2"}], 
                    "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"1", ",", "x"}], "}"}], ",", "x"}], "]"}], 
                    "]"}]}], ";", "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"cfa", "[", "x_", "]"}], "=", 
                    RowBox[{"Normal", "[", 
                    RowBox[{"Calibratefunction", "[", "x", "]"}], "]"}]}], 
                    ";", "\[IndentingNewLine]", 
                    RowBox[{"areacalibrationdata", "=", 
                    RowBox[{"Join", "[", 
                    RowBox[{
                    RowBox[{"Partition", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    RowBox[{"#", "[", 
                    RowBox[{"[", "3", "]"}], "]"}], "&"}], "/@", 
                    "calibrateintensities"}], ",", "1"}], "]"}], ",", 
                    RowBox[{"Partition", "[", 
                    RowBox[{"hertzthickneses", ",", "1"}], "]"}], ",", "2"}], 
                    "]"}]}], ";", "\[IndentingNewLine]", 
                    RowBox[{"calibratedcontacts", "=", 
                    RowBox[{"Table", "[", 
                    RowBox[{
                    RowBox[{"Map", "[", 
                    RowBox[{"Calibratefunction", ",", 
                    RowBox[{"ImageData", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"Join", "[", 
                    RowBox[{"normalizedstatics", ",", "normalizedcontacts"}], 
                    "]"}], "[", 
                    RowBox[{"[", "i", "]"}], "]"}], ",", "\"\<Bit16\>\""}], 
                    "]"}]}], "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"i", ",", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", 
                    RowBox[{"Join", "[", 
                    RowBox[{"normalizedstatics", ",", "normalizedcontacts"}], 
                    "]"}], "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], "]"}]}], ";"}],
                     ",", 
                    RowBox[{"Method", "\[Rule]", "\"\<Queued\>\""}]}], "]"}], 
                    "]"}], ",", "\[IndentingNewLine]", 
                    RowBox[{"Dynamic", "[", 
                    RowBox[{"Button", "[", 
                    RowBox[{
                    "\"\<Solve line calibration\>\"", ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"a", "=", 
                    RowBox[{
                    RowBox[{"EuclideanDistance", "[", 
                    RowBox[{
                    RowBox[{"contactcenters", "[", 
                    RowBox[{"[", "calibrateimage", "]"}], "]"}], ",", 
                    "contactradius"}], "]"}], 
                    FractionBox[
                    RowBox[{"pixelsize", " ", "pixelbinning"}], 
                    "magnification"], 
                    SuperscriptBox["10", 
                    RowBox[{"-", "3"}]]}]}], ";", "\[IndentingNewLine]", 
                    RowBox[{"calibratepoints", "=", 
                    RowBox[{"Cases", "[", 
                    RowBox[{"calibrateintensities", ",", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Round", "[", 
                    RowBox[{
                    RowBox[{"contactcenters", "[", 
                    RowBox[{"[", "calibrateimage", "]"}], "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", "_", ",", 
                    "_"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", 
                    RowBox[{"intensitydistances", "=", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"(", 
                    RowBox[{
                    RowBox[{"EuclideanDistance", "[", 
                    RowBox[{
                    RowBox[{"#", "[", 
                    RowBox[{"[", 
                    RowBox[{"1", ";;", "2"}], "]"}], "]"}], ",", 
                    RowBox[{"contactcenters", "[", 
                    RowBox[{"[", "calibrateimage", "]"}], "]"}]}], "]"}], 
                    FractionBox[
                    RowBox[{"pixelsize", " ", "pixelbinning"}], 
                    "magnification"], 
                    SuperscriptBox["10", 
                    RowBox[{"-", "3"}]]}], ")"}], "&"}], "/@", 
                    "calibratepoints"}]}], ";", "\[IndentingNewLine]", 
                    RowBox[{"hertzthickneses", "=", 
                    RowBox[{
                    RowBox[{"H", "[", "intensitydistances", "]"}], 
                    SuperscriptBox["10", "3"]}]}], ";", "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"Calibratefunction", "[", "x_", "]"}], "=", 
                    RowBox[{"Normal", "[", 
                    RowBox[{"LinearModelFit", "[", 
                    RowBox[{
                    RowBox[{"Join", "[", 
                    RowBox[{
                    RowBox[{"Partition", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    RowBox[{"#", "[", 
                    RowBox[{"[", "3", "]"}], "]"}], "&"}], "/@", 
                    "calibratepoints"}], ",", "1"}], "]"}], ",", 
                    RowBox[{"Partition", "[", 
                    RowBox[{"hertzthickneses", ",", "1"}], "]"}], ",", "2"}], 
                    "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"1", ",", "x"}], "}"}], ",", "x"}], "]"}], 
                    "]"}]}], ";", "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"cfl", "[", "x_", "]"}], "=", 
                    RowBox[{"Normal", "[", 
                    RowBox[{"Calibratefunction", "[", "x", "]"}], "]"}]}], 
                    ";", "\[IndentingNewLine]", 
                    RowBox[{"linecalibrationdata", "=", 
                    RowBox[{"Join", "[", 
                    RowBox[{
                    RowBox[{"Partition", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    RowBox[{"#", "[", 
                    RowBox[{"[", "3", "]"}], "]"}], "&"}], "/@", 
                    "calibratepoints"}], ",", "1"}], "]"}], ",", 
                    RowBox[{"Partition", "[", 
                    RowBox[{"hertzthickneses", ",", "1"}], "]"}], ",", "2"}], 
                    "]"}]}], ";", "\[IndentingNewLine]", 
                    RowBox[{"calibratedcontacts", "=", 
                    RowBox[{"Table", "[", 
                    RowBox[{
                    RowBox[{"Map", "[", 
                    RowBox[{"Calibratefunction", ",", 
                    RowBox[{"ImageData", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"Join", "[", 
                    RowBox[{"normalizedstatics", ",", "normalizedcontacts"}], 
                    "]"}], "[", 
                    RowBox[{"[", "i", "]"}], "]"}], ",", "\"\<Bit16\>\""}], 
                    "]"}]}], "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"i", ",", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", 
                    RowBox[{"Join", "[", 
                    RowBox[{"normalizedstatics", ",", "normalizedcontacts"}], 
                    "]"}], "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], "]"}]}], 
                    ";"}]}], "]"}], "]"}], ",", "\[IndentingNewLine]", 
                    RowBox[{"Button", "[", 
                    RowBox[{"\"\<Export contact images\>\"", ",", 
                    RowBox[{"Table", "[", 
                    RowBox[{
                    RowBox[{"Export", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    RowBox[{"Join", "[", 
                    RowBox[{"staticnames", ",", "contactnames"}], "]"}], "[", 
                    
                    RowBox[{"[", "i", "]"}], "]"}], "<>", "\"\<.eps\>\""}], 
                    ",", 
                    RowBox[{"Colorize", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"Join", "[", 
                    RowBox[{"normalizedstatics", ",", "normalizedcontacts"}], 
                    "]"}], "[", 
                    RowBox[{"[", "i", "]"}], "]"}], ",", 
                    RowBox[{"ColorFunction", "\[Rule]", "\"\<Rainbow\>\""}]}],
                     "]"}], ",", "\"\<eps\>\""}], "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"i", ",", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", 
                    RowBox[{"Join", "[", 
                    RowBox[{"normalizedstatics", ",", "normalizedcontacts"}], 
                    "]"}], "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], "]"}], ",", 
                    RowBox[{"Method", "\[Rule]", "\"\<Queued\>\""}]}], "]"}], 
                    ",", "\[IndentingNewLine]", 
                    RowBox[{"Button", "[", 
                    RowBox[{"\"\<Export central thickness\>\"", ",", 
                    RowBox[{"Export", "[", 
                    RowBox[{
                    RowBox[{"\"\<Film thickneses\>\"", "<>", "\"\<.txt\>\""}],
                     ",", 
                    RowBox[{"Join", "[", 
                    RowBox[{
                    RowBox[{"Partition", "[", 
                    RowBox[{
                    RowBox[{"ToExpression", "[", 
                    RowBox[{
                    RowBox[{"Join", "[", 
                    RowBox[{"staticnames", ",", "contactnames"}], "]"}], "/.", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"\"\<Static1\>\"", "\[Rule]", "0"}], ",", 
                    RowBox[{"\"\<Static2\>\"", "\[Rule]", "0"}], ",", 
                    RowBox[{"\"\<Static3\>\"", "\[Rule]", "0"}]}], "}"}]}], 
                    "]"}], ",", "1"}], "]"}], ",", 
                    RowBox[{"Flatten", "[", 
                    RowBox[{
                    RowBox[{"Table", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    RowBox[{"Take", "[", 
                    RowBox[{
                    RowBox[{"calibratedcontacts", "[", 
                    RowBox[{"[", "i", "]"}], "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Round", "@", 
                    RowBox[{"(", 
                    RowBox[{
                    FractionBox["imagesizey", "pixelbinning"], "-", 
                    RowBox[{"#", "[", 
                    RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}], ",", 
                    RowBox[{"Round", "@", 
                    RowBox[{"(", 
                    RowBox[{
                    FractionBox["imagesizey", "pixelbinning"], "-", 
                    RowBox[{"#", "[", 
                    RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}]}], "}"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Round", "@", 
                    RowBox[{"#", "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], ",", 
                    RowBox[{"Round", "@", 
                    RowBox[{"#", "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}]}], "}"}]}], "]"}], "&"}],
                     "/@", 
                    RowBox[{
                    RowBox[{"Partition", "[", 
                    RowBox[{"contactcenters", ",", "1"}], "]"}], "[", 
                    RowBox[{"[", "i", "]"}], "]"}]}], ",", 
                    RowBox[{"{", 
                    RowBox[{"i", ",", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", "calibratedcontacts", "]"}], 
                    "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], "]"}], ",", 
                    "2"}], "]"}], ",", "2"}], "]"}], ",", "\"\<Text\>\""}], 
                    "]"}]}], "]"}]}], "\[IndentingNewLine]", "}"}], ",", 
                   RowBox[{"Alignment", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{"Left", " ", ",", "Top"}], "}"}]}]}], "]"}]}], 
                "\[IndentingNewLine]", "}"}], ",", 
               RowBox[{"Alignment", "\[Rule]", 
                RowBox[{"{", 
                 RowBox[{"Left", ",", "Top"}], "}"}]}]}], 
              "\[IndentingNewLine]", "]"}], ",", 
             RowBox[{"Dynamic", "[", 
              RowBox[{"Grid", "[", 
               RowBox[{"Transpose", "[", 
                RowBox[{"Partition", "[", 
                 RowBox[{
                  RowBox[{"Table", "[", "\[IndentingNewLine]", 
                   RowBox[{
                    RowBox[{"With", "[", 
                    RowBox[{
                    RowBox[{"{", 
                    RowBox[{"i", "=", "i"}], "}"}], ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"Grid", "[", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"{", "\[IndentingNewLine]", 
                    RowBox[{"Dynamic", "[", 
                    RowBox[{"If", "[", 
                    RowBox[{"imageconvolution", ",", 
                    RowBox[{
                    RowBox[{"imagecontactprocessing", "[", 
                    RowBox[{"ImageConvolve", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"Join", "[", 
                    RowBox[{"normalizedstatics", ",", "normalizedcontacts"}], 
                    "]"}], "[", 
                    RowBox[{"[", 
                    RowBox[{"shownimages", "[", 
                    RowBox[{"[", "i", "]"}], "]"}], "]"}], "]"}], ",", 
                    "convolutionmatrix"}], "]"}], "]"}], "[", 
                    RowBox[{"[", 
                    RowBox[{"1", ",", "2"}], "]"}], "]"}], ",", 
                    RowBox[{
                    RowBox[{"imagecontactprocessing", "[", 
                    RowBox[{
                    RowBox[{"Join", "[", 
                    RowBox[{"normalizedstatics", ",", "normalizedcontacts"}], 
                    "]"}], "[", 
                    RowBox[{"[", 
                    RowBox[{"shownimages", "[", 
                    RowBox[{"[", "i", "]"}], "]"}], "]"}], "]"}], "]"}], "[", 
                    
                    RowBox[{"[", 
                    RowBox[{"1", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}], 
                    "\[IndentingNewLine]", "}"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"Dynamic", "[", 
                    RowBox[{"If", "[", 
                    RowBox[{"imageconvolution", ",", 
                    RowBox[{
                    RowBox[{"imagecontactprocessing", "[", 
                    RowBox[{"ImageConvolve", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"Join", "[", 
                    RowBox[{"normalizedstatics", ",", "normalizedcontacts"}], 
                    "]"}], "[", 
                    RowBox[{"[", 
                    RowBox[{"shownimages", "[", 
                    RowBox[{"[", "i", "]"}], "]"}], "]"}], "]"}], ",", 
                    "convolutionmatrix"}], "]"}], "]"}], "[", 
                    RowBox[{"[", 
                    RowBox[{"1", ",", "1"}], "]"}], "]"}], ",", 
                    RowBox[{
                    RowBox[{"imagecontactprocessing", "[", 
                    RowBox[{
                    RowBox[{"Join", "[", 
                    RowBox[{"normalizedstatics", ",", "normalizedcontacts"}], 
                    "]"}], "[", 
                    RowBox[{"[", 
                    RowBox[{"shownimages", "[", 
                    RowBox[{"[", "i", "]"}], "]"}], "]"}], "]"}], "]"}], "[", 
                    
                    RowBox[{"[", 
                    RowBox[{"1", ",", "1"}], "]"}], "]"}]}], "]"}], "]"}], 
                    "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", 
                    
                    RowBox[{"{", 
                    RowBox[{"Button", "[", 
                    RowBox[{"\"\<Save\>\"", ",", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"contactcenters", "[", 
                    RowBox[{"[", 
                    RowBox[{"shownimages", "[", 
                    RowBox[{"[", "i", "]"}], "]"}], "]"}], "]"}], "=", 
                    "contactcenter"}], ";"}]}], "]"}], "\[IndentingNewLine]", 
                    "}"}]}], "}"}], "]"}]}], "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"i", ",", "1", ",", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", "shownimages", "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], "]"}], ",", 
                  "1"}], "]"}], "]"}], "]"}], "]"}]}], "}"}], 
           "\[IndentingNewLine]", ",", 
           RowBox[{"Alignment", "\[Rule]", 
            RowBox[{"{", 
             RowBox[{"Left", " ", ",", "Top"}], "}"}]}]}], "]"}], 
         "\[IndentingNewLine]", "\[IndentingNewLine]", "}"}]}], "}"}], 
      "\[IndentingNewLine]", ",", 
      RowBox[{"Alignment", "\[Rule]", 
       RowBox[{"{", 
        RowBox[{"Left", ",", "Top"}], "}"}]}]}], "]"}], "\[IndentingNewLine]",
     ",", 
    RowBox[{"Background", "\[Rule]", 
     RowBox[{"RGBColor", "[", 
      RowBox[{"0.85", ",", "0.85", ",", "0.85"}], "]"}]}]}], 
   "\[IndentingNewLine]", "]"}]}]], "Input",
 CellChangeTimes->{{3.6321379323822203`*^9, 3.6321379613594313`*^9}, {
   3.6321387539430656`*^9, 3.632138764308057*^9}, {3.632139201383767*^9, 
   3.6321392717906523`*^9}, {3.63213962643114*^9, 3.6321396500840693`*^9}, {
   3.632139737700409*^9, 3.632139743284437*^9}, {3.632139786176469*^9, 
   3.632139798863305*^9}, {3.632139947762846*^9, 3.632140013810684*^9}, 
   3.632140078350103*^9, {3.6321401305459957`*^9, 3.632140203980689*^9}, {
   3.6321402387106657`*^9, 3.6321402529358788`*^9}, {3.6321404150975447`*^9, 
   3.632140600786749*^9}, {3.632145754212387*^9, 3.632145772988286*^9}, {
   3.632145838184607*^9, 3.6321459141052322`*^9}, {3.632146028200499*^9, 
   3.6321460572290993`*^9}, {3.632149823652678*^9, 3.6321498241319532`*^9}, {
   3.632151507311006*^9, 3.632151519114874*^9}, {3.632152434178294*^9, 
   3.632152481737815*^9}, {3.632152520142803*^9, 3.6321525411498537`*^9}, {
   3.63215259353493*^9, 3.632152594654361*^9}, {3.63215282815169*^9, 
   3.63215284540907*^9}, {3.63215288713344*^9, 3.632152927218452*^9}, {
   3.632152963477117*^9, 3.6321529951776657`*^9}, {3.632153048499029*^9, 
   3.632153049780237*^9}, {3.632153108003757*^9, 3.6321531576002274`*^9}, {
   3.632153191473967*^9, 3.632153206149205*^9}, {3.6323815626567707`*^9, 
   3.632381618827874*^9}, {3.63238166062498*^9, 3.632381754638435*^9}, {
   3.6323820566261587`*^9, 3.632382102747262*^9}, {3.632382157919393*^9, 
   3.632382168358436*^9}, {3.6323822345859528`*^9, 3.632382288725472*^9}, 
   3.632382351015423*^9, {3.632459822878606*^9, 3.632459824679763*^9}, {
   3.632459930637195*^9, 3.63245994879819*^9}, {3.632466769829706*^9, 
   3.6324667765854816`*^9}, {3.632466922703026*^9, 3.632466937766005*^9}, {
   3.632467024403013*^9, 3.632467052925035*^9}, {3.6324671196011267`*^9, 
   3.632467119920272*^9}, {3.632467271264423*^9, 3.632467335399536*^9}, {
   3.632467386670483*^9, 3.632467488962903*^9}, 3.632468964623658*^9, {
   3.6324695503932133`*^9, 3.632469566553846*^9}, {3.632473194621521*^9, 
   3.632473231332076*^9}, {3.632479948130756*^9, 3.632479949172654*^9}, {
   3.632479981153591*^9, 3.632480001006949*^9}, {3.632480111978957*^9, 
   3.632480113047336*^9}, {3.632480667045133*^9, 3.63248066786429*^9}, {
   3.632480790329103*^9, 3.6324808104945173`*^9}, {3.632480887461643*^9, 
   3.632481009714079*^9}, {3.632481045338334*^9, 3.632481058272929*^9}, {
   3.6324811055226383`*^9, 3.632481108047411*^9}, {3.632481209163567*^9, 
   3.632481245007736*^9}, 3.63248211284615*^9, 3.63248260591282*^9, {
   3.632485414514185*^9, 3.6324854175538597`*^9}, {3.6324855018582582`*^9, 
   3.6324855045498867`*^9}, 3.63251112685393*^9, {3.632511188424666*^9, 
   3.6325112331858263`*^9}, {3.632511303610701*^9, 3.632511324555661*^9}, {
   3.632511526466386*^9, 3.632511641932728*^9}, {3.632511702161046*^9, 
   3.632511715713533*^9}, {3.6325119705173397`*^9, 3.63251197249501*^9}, {
   3.632512038714253*^9, 3.63251208446196*^9}, {3.632512122300411*^9, 
   3.6325122398928747`*^9}, {3.6325123620854273`*^9, 3.632512362754938*^9}, {
   3.632512689171294*^9, 3.63251271429788*^9}, {3.6325131087771177`*^9, 
   3.63251312163326*^9}, {3.6325134520747957`*^9, 3.632513467298514*^9}, {
   3.63251363885116*^9, 3.632513669568329*^9}, {3.632544078207457*^9, 
   3.632544225978262*^9}, {3.6325442592982283`*^9, 3.632544644270505*^9}, {
   3.632544721678252*^9, 3.632544729168357*^9}, {3.632544889722753*^9, 
   3.632545103486539*^9}, {3.6325453366958237`*^9, 3.632545351461882*^9}, {
   3.6325464198522863`*^9, 3.632546432065505*^9}, {3.632546627833536*^9, 
   3.632546703760182*^9}, {3.6325468832448378`*^9, 3.632546939877408*^9}, {
   3.632547041195941*^9, 3.632547084553133*^9}, {3.6325471194387627`*^9, 
   3.632547234627838*^9}, {3.632547476213971*^9, 3.63254747655202*^9}, 
   3.632985984966074*^9, {3.632986171958057*^9, 3.6329861725187893`*^9}, 
   3.632986448801887*^9, {3.632986612765724*^9, 3.632986615189432*^9}, {
   3.633025432392664*^9, 3.6330255316656733`*^9}, {3.633025629304612*^9, 
   3.6330257111977262`*^9}, {3.633025809361261*^9, 3.633025828065238*^9}, {
   3.633025946716281*^9, 3.6330259489240007`*^9}, {3.633025986242854*^9, 
   3.6330260227596292`*^9}, {3.633026983149123*^9, 3.633027012171723*^9}, {
   3.6330270753683653`*^9, 3.633027096885714*^9}, {3.633027162032051*^9, 
   3.633027276952612*^9}, {3.633057842504464*^9, 3.633057863821926*^9}, {
   3.63305790222635*^9, 3.633057912085978*^9}, {3.6330629538160553`*^9, 
   3.6330629567431507`*^9}, {3.6330630452004004`*^9, 3.633063071407531*^9}, {
   3.633063116329978*^9, 3.633063150714114*^9}, {3.633063193663375*^9, 
   3.633063206866095*^9}, {3.633063248683029*^9, 3.633063288813447*^9}, {
   3.633063322871605*^9, 3.633063340794488*^9}, {3.633063394917*^9, 
   3.63306339558009*^9}, {3.633063433670899*^9, 3.63306347636126*^9}, {
   3.633063687083322*^9, 3.633063687980546*^9}, {3.633065375200389*^9, 
   3.6330653926895037`*^9}, {3.633068572110181*^9, 3.6330685754781103`*^9}, {
   3.633068644874919*^9, 3.633068669648644*^9}, {3.633068750321863*^9, 
   3.6330687720395927`*^9}, {3.633080694071639*^9, 3.6330807807440977`*^9}, {
   3.6330808556053677`*^9, 3.6330808615873823`*^9}, {3.633080910711947*^9, 
   3.6330809265853767`*^9}, {3.633080960068207*^9, 3.633080994518057*^9}, {
   3.63308102465584*^9, 3.633081060856161*^9}, {3.6331985872610064`*^9, 
   3.6331985915222*^9}, {3.63369107970481*^9, 3.6336911136501007`*^9}, {
   3.633691144408566*^9, 3.6336912339411716`*^9}, {3.633692269858041*^9, 
   3.6336922745758343`*^9}, {3.6336924797986183`*^9, 3.633692571896894*^9}, {
   3.633692634309587*^9, 3.633692658025826*^9}, 3.6336927190279627`*^9, {
   3.633692760375641*^9, 3.633692801019068*^9}, {3.633692837699842*^9, 
   3.633692843373344*^9}, {3.6336928735130043`*^9, 3.633692934583469*^9}, {
   3.633692992427065*^9, 3.6336930265920277`*^9}, {3.633693058470023*^9, 
   3.633693298801916*^9}, {3.6336933624293222`*^9, 3.633693439855666*^9}, {
   3.633693538459684*^9, 3.6336935721054688`*^9}, {3.633693954249482*^9, 
   3.633693956997653*^9}, {3.633693999766412*^9, 3.633694013796585*^9}, {
   3.633695929340917*^9, 3.633696043464765*^9}, {3.633696107891083*^9, 
   3.63369615260181*^9}, {3.633696213686165*^9, 3.6336962442626047`*^9}, {
   3.6337004804460583`*^9, 3.633700481473433*^9}, {3.633787791609476*^9, 
   3.633787792292083*^9}, {3.633805635321591*^9, 3.6338056366938953`*^9}, {
   3.634286367068591*^9, 3.6342863694061193`*^9}, {3.6354470126021013`*^9, 
   3.635447033905842*^9}, {3.635447083040215*^9, 3.635447101776793*^9}, {
   3.63544713920778*^9, 3.635447150156876*^9}, {3.635448439454146*^9, 
   3.635448466734861*^9}, {3.6354831505020323`*^9, 3.6354831522808943`*^9}, {
   3.635484599282968*^9, 3.635484613863553*^9}, {3.635668625086709*^9, 
   3.6356686301330767`*^9}, {3.635751762078107*^9, 3.635751798255455*^9}, {
   3.635751962540636*^9, 3.6357519723901653`*^9}, {3.63575205922197*^9, 
   3.6357520678703547`*^9}, 3.635752106589901*^9, {3.63575215026537*^9, 
   3.6357522382587643`*^9}},
 ImageSize->{350, 350},
 Antialiasing->Automatic],

Cell[BoxData[
 PanelBox[
  TagBox[GridBox[{
     {
      TagBox[GridBox[{
         {"\<\"Show images:\"\>"},
         {
          InterpretationBox[
           StyleBox[GridBox[{
              {
               SetterBox[Dynamic[
                 MemberQ[$CellContext`shownimages, 1], 
                 BoxForm`TogglerBarFunction[$CellContext`shownimages, 1]& ], {
                True}, "\<\"Static\"\>"], 
               SetterBox[Dynamic[
                 MemberQ[$CellContext`shownimages, 2], 
                 BoxForm`TogglerBarFunction[$CellContext`shownimages, 2]& ], {
                True}, "\<\"100\"\>"], 
               SetterBox[Dynamic[
                 MemberQ[$CellContext`shownimages, 3], 
                 BoxForm`TogglerBarFunction[$CellContext`shownimages, 3]& ], {
                True}, "\<\"10\"\>"], 
               SetterBox[Dynamic[
                 MemberQ[$CellContext`shownimages, 4], 
                 BoxForm`TogglerBarFunction[$CellContext`shownimages, 4]& ], {
                True}, "\<\"150\"\>"], 
               SetterBox[Dynamic[
                 MemberQ[$CellContext`shownimages, 5], 
                 BoxForm`TogglerBarFunction[$CellContext`shownimages, 5]& ], {
                True}, "\<\"200\"\>"], 
               SetterBox[Dynamic[
                 MemberQ[$CellContext`shownimages, 6], 
                 BoxForm`TogglerBarFunction[$CellContext`shownimages, 6]& ], {
                True}, "\<\"20\"\>"], 
               SetterBox[Dynamic[
                 MemberQ[$CellContext`shownimages, 7], 
                 BoxForm`TogglerBarFunction[$CellContext`shownimages, 7]& ], {
                True}, "\<\"300\"\>"], 
               SetterBox[Dynamic[
                 MemberQ[$CellContext`shownimages, 8], 
                 BoxForm`TogglerBarFunction[$CellContext`shownimages, 8]& ], {
                True}, "\<\"400\"\>"], 
               SetterBox[Dynamic[
                 MemberQ[$CellContext`shownimages, 9], 
                 BoxForm`TogglerBarFunction[$CellContext`shownimages, 9]& ], {
                True}, "\<\"40\"\>"], 
               SetterBox[Dynamic[
                 MemberQ[$CellContext`shownimages, 10], 
                 BoxForm`TogglerBarFunction[$CellContext`shownimages, 
                  10]& ], {True}, "\<\"500\"\>"], 
               SetterBox[Dynamic[
                 MemberQ[$CellContext`shownimages, 11], 
                 BoxForm`TogglerBarFunction[$CellContext`shownimages, 
                  11]& ], {True}, "\<\"5\"\>"], 
               SetterBox[Dynamic[
                 MemberQ[$CellContext`shownimages, 12], 
                 BoxForm`TogglerBarFunction[$CellContext`shownimages, 
                  12]& ], {True}, "\<\"60\"\>"], 
               SetterBox[Dynamic[
                 MemberQ[$CellContext`shownimages, 13], 
                 BoxForm`TogglerBarFunction[$CellContext`shownimages, 
                  13]& ], {True}, "\<\"80\"\>"]}
             },
             BaselinePosition->{1, 1},
             GridBoxSpacings->{"Columns" -> {
                 Offset[0.27999999999999997`], {
                  Offset[0.]}, 
                 Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, 
               "Rows" -> {
                 Offset[0.2], {
                  Offset[0.4]}, 
                 Offset[0.2]}, "RowsIndexed" -> {}}],
            Deployed->True],
           TogglerBar[
            Dynamic[$CellContext`shownimages], {
            1 -> "Static", 2 -> "100", 3 -> "10", 4 -> "150", 5 -> "200", 6 -> 
             "20", 7 -> "300", 8 -> "400", 9 -> "40", 10 -> "500", 11 -> "5", 
             12 -> "60", 13 -> "80"}]]}
        },
        DefaultBaseStyle->"Column",
        GridBoxAlignment->{"Columns" -> {{Left}}},
        GridBoxItemSize->{
         "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}],
       "Column"]},
     {
      TemplateBox[{TagBox[
         GridBox[{{
            ButtonBox[
            "\"Show All\"", 
             ButtonFunction :> ($CellContext`shownimages = Range[
                Part[
                 Dimensions[
                  Join[$CellContext`staticnames, $CellContext`contactnames]], 
                 1]]), Appearance -> Automatic, Evaluator -> Automatic, 
             Method -> "Preemptive"]}, {
            ButtonBox[
            "\"Hide All\"", ButtonFunction :> ($CellContext`shownimages = {}),
              Appearance -> Automatic, Evaluator -> Automatic, Method -> 
             "Preemptive"]}, {
            ButtonBox[
            "\"Convolution\"", ButtonFunction :> 
             If[$CellContext`imageconvolution == 
               False, $CellContext`imageconvolution = 
               True, $CellContext`imageconvolution = False], Appearance -> 
             Dynamic[
               If[$CellContext`imageconvolution, "Pressed", "DialogBox"]], 
             Evaluator -> Automatic, Method -> "Preemptive"]}, {
           "\"Convolution matrix:\""}, {
            TagBox[
             GridBox[{{
                InputFieldBox[
                 Dynamic[
                  Part[$CellContext`convolutionmatrix, 1, 1]], 
                 FieldSize -> {1.7, 1}], 
                InputFieldBox[
                 Dynamic[
                  Part[$CellContext`convolutionmatrix, 1, 2]], 
                 FieldSize -> {1.7, 1}], 
                InputFieldBox[
                 Dynamic[
                  Part[$CellContext`convolutionmatrix, 1, 3]], 
                 FieldSize -> {1.7, 1}]}, {
                InputFieldBox[
                 Dynamic[
                  Part[$CellContext`convolutionmatrix, 2, 1]], 
                 FieldSize -> {1.7, 1}], 
                InputFieldBox[
                 Dynamic[
                  Part[$CellContext`convolutionmatrix, 2, 2]], 
                 FieldSize -> {1.7, 1}], 
                InputFieldBox[
                 Dynamic[
                  Part[$CellContext`convolutionmatrix, 2, 3]], 
                 FieldSize -> {1.7, 1}]}, {
                InputFieldBox[
                 Dynamic[
                  Part[$CellContext`convolutionmatrix, 3, 1]], 
                 FieldSize -> {1.7, 1}], 
                InputFieldBox[
                 Dynamic[
                  Part[$CellContext`convolutionmatrix, 3, 2]], 
                 FieldSize -> {1.7, 1}], 
                InputFieldBox[
                 Dynamic[
                  Part[$CellContext`convolutionmatrix, 3, 3]], 
                 FieldSize -> {1.7, 1}]}}, AutoDelete -> False, 
              GridBoxItemSize -> {
               "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], 
             "Grid"]}, {"\"Contact radius trim:\""}, {
            TemplateBox[{
              ButtonBox[
              "\"+\"", ButtonFunction :> 
               Dynamic[$CellContext`contactradius = \
$CellContext`contactradius + 0.7], Appearance -> Automatic, Evaluator -> 
               Automatic, Method -> "Preemptive"], 
              ButtonBox[
              "\"-\"", ButtonFunction :> 
               Dynamic[$CellContext`contactradius = \
$CellContext`contactradius - 0.7], Appearance -> Automatic, Evaluator -> 
               Automatic, Method -> "Preemptive"]}, "RowDefault"]}, {
           "\"Contact center trim:\""}, {
            TagBox[
             GridBox[{{
                ButtonBox[
                "\"\[Wedge]\"", ButtonFunction :> 
                 Dynamic[
                  Part[$CellContext`contactcenter, 2] = 
                    Part[$CellContext`contactcenter, 2] + 1; 
                   Part[$CellContext`contactradius, 2] = 
                    Part[$CellContext`contactradius, 2] + 1; Null], ImageSize -> 
                 50, Appearance -> Automatic, Evaluator -> Automatic, Method -> 
                 "Preemptive"]}, {
                TemplateBox[{
                  ButtonBox[
                  "\"<\"", ButtonFunction :> 
                   Dynamic[
                    Part[$CellContext`contactcenter, 1] = 
                    Part[$CellContext`contactcenter, 1] - 1; 
                    Part[$CellContext`contactradius, 1] = 
                    Part[$CellContext`contactradius, 1] - 1; Null], 
                   Appearance -> Automatic, Evaluator -> Automatic, Method -> 
                   "Preemptive"], 
                  ButtonBox[
                  "\">\"", ButtonFunction :> 
                   Dynamic[
                    Part[$CellContext`contactcenter, 1] = 
                    Part[$CellContext`contactcenter, 1] + 1; 
                    Part[$CellContext`contactradius, 1] = 
                    Part[$CellContext`contactradius, 1] + 1; Null], 
                   Appearance -> Automatic, Evaluator -> Automatic, Method -> 
                   "Preemptive"]}, "RowDefault"]}, {
                ButtonBox[
                "\"\[Vee]\"", ButtonFunction :> 
                 Dynamic[
                  Part[$CellContext`contactcenter, 2] = 
                    Part[$CellContext`contactcenter, 2] - 1; 
                   Part[$CellContext`contactradius, 2] = 
                    Part[$CellContext`contactradius, 2] - 1; Null], ImageSize -> 
                 50, Appearance -> Automatic, Evaluator -> Automatic, Method -> 
                 "Preemptive"]}}, 
              GridBoxAlignment -> {"Columns" -> {{Center}}}, DefaultBaseStyle -> 
              "Column", 
              GridBoxItemSize -> {
               "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], 
             "Column"]}, {
            PanelBox[
             TagBox[
              GridBox[{{
                 RowBox[{"\"Image size: \"", " ", 
                   DynamicBox[
                    ToBoxes[$CellContext`imagesize, StandardForm]]}]}, {
                 SliderBox[
                  Dynamic[$CellContext`imagesize], {100, 1000, 1}, ImageSize -> 
                  147]}, {
                 RowBox[{"\"Plot range: \"", " ", 
                   DynamicBox[
                    ToBoxes[$CellContext`plotrange, StandardForm]]}]}, {
                 SliderBox[
                  Dynamic[$CellContext`plotrange], {0.1, 65000, 1}, ImageSize -> 
                  147]}, {"\"Inner clibration boundary\""}, {
                 RowBox[{"\"Radius: \"", " ", 
                   DynamicBox[
                    ToBoxes[$CellContext`innercalibcircle, StandardForm]]}]}, {
                 SliderBox[
                  Dynamic[
                   BoxForm`RemapVariable[$CellContext`innercalibcircle, {1, 
                    Rational[375, 2], 1}], 
                   BoxForm`RemapValue[#, $CellContext`innercalibcircle, {1, 
                    Rational[375, 2], 1}]& ], {0, 
                   Rational[373, 2], 1}, ImageSize -> 147]}, {
                "\"Outer calibration boundary\""}, {
                 RowBox[{"\"Radius: \"", " ", 
                   DynamicBox[
                    ToBoxes[$CellContext`outercalibcircle, StandardForm]]}]}, {
                 SliderBox[
                  Dynamic[
                   BoxForm`RemapVariable[$CellContext`outercalibcircle, {1, 
                    Rational[375, 2], 1}], 
                   BoxForm`RemapValue[#, $CellContext`outercalibcircle, {1, 
                    Rational[375, 2], 1}]& ], {0, 
                   Rational[373, 2], 1}, ImageSize -> 147]}, {
                "\"Central thickness boundary\""}, {
                 RowBox[{"\"Radius: \"", " ", 
                   DynamicBox[
                    ToBoxes[$CellContext`cftavcircle, StandardForm]]}]}, {
                 SliderBox[
                  Dynamic[
                   BoxForm`RemapVariable[$CellContext`cftavcircle, {1, 
                    Rational[375, 4], 1}], 
                   BoxForm`RemapValue[#, $CellContext`cftavcircle, {1, 
                    Rational[375, 4], 1}]& ], {0, 
                   Rational[371, 4], 1}, ImageSize -> 147]}}, 
               GridBoxAlignment -> {"Columns" -> {{Left}}}, DefaultBaseStyle -> 
               "Column", 
               GridBoxItemSize -> {
                "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], 
              "Column"], Background -> GrayLevel[1]]}, {
            ButtonBox[
            "\"Save all from static\"", 
             ButtonFunction :> (Part[$CellContext`contactcenters, 
                Span[1, 
                 Part[
                  Dimensions[$CellContext`contactcenters], 
                  1]]] = $CellContext`contactcenter), Appearance -> Automatic,
              Evaluator -> Automatic, Method -> "Preemptive"]}, {
            DynamicBox[
             ToBoxes[
              PopupMenu[
               Dynamic[$CellContext`calibrateimage], 
               Apply[# -> #2& , 
                Transpose[{
                  Range[
                   Part[
                    Dimensions[
                    
                    Join[$CellContext`staticnames, \
$CellContext`contactnames]], 1]], 
                  
                  Join[$CellContext`staticnames, \
$CellContext`contactnames]}], {1}]], StandardForm]]}, {
            ButtonBox[
            "\"Select calibration points\"", 
             ButtonFunction :> ($CellContext`calibrateintensities = Flatten[
                $CellContext`selectcalibrationdata[
                 Part[
                  
                  Join[$CellContext`normalizedstatics, \
$CellContext`normalizedcontacts], $CellContext`calibrateimage]], 1]), Method -> 
             "Queued", Appearance -> Automatic, Evaluator -> Automatic]}, {
            TagBox[
             GridBox[{{
                DynamicBox[
                 ToBoxes[
                  Button[
                  "Solve area calibration", $CellContext`a = EuclideanDistance[
                    
                    Part[$CellContext`contactcenters, \
$CellContext`calibrateimage], $CellContext`contactradius] \
($CellContext`pixelsize $CellContext`pixelbinning/$CellContext`magnification) 
                    10^(-3); $CellContext`intensitydistances = 
                    Map[EuclideanDistance[
                    Part[#, 
                    Span[1, 2]], 
                    
                    Part[$CellContext`contactcenters, \
$CellContext`calibrateimage]] ($CellContext`pixelsize \
$CellContext`pixelbinning/$CellContext`magnification) 
                    10^(-3)& , $CellContext`calibrateintensities]; \
$CellContext`hertzthickneses = $CellContext`H[$CellContext`intensitydistances]
                     10^3; $CellContext`Calibratefunction[
                    Pattern[$CellContext`x, 
                    Blank[]]] = Normal[
                    LinearModelFit[
                    Join[
                    Partition[
                    Map[Part[#, 3]& , $CellContext`calibrateintensities], 1], 
                    
                    Partition[$CellContext`hertzthickneses, 1], 2], {
                    1, $CellContext`x}, $CellContext`x]]; $CellContext`cfa[
                    Pattern[$CellContext`x, 
                    Blank[]]] = Normal[
                    $CellContext`Calibratefunction[$CellContext`x]]; \
$CellContext`areacalibrationdata = Join[
                    Partition[
                    Map[Part[#, 3]& , $CellContext`calibrateintensities], 1], 
                    
                    Partition[$CellContext`hertzthickneses, 1], 
                    2]; $CellContext`calibratedcontacts = Table[
                    Map[$CellContext`Calibratefunction, 
                    ImageData[
                    Part[
                    
                    Join[$CellContext`normalizedstatics, \
$CellContext`normalizedcontacts], $CellContext`i], "Bit16"]], {$CellContext`i, 
                    Part[
                    Dimensions[
                    
                    Join[$CellContext`normalizedstatics, \
$CellContext`normalizedcontacts]], 1]}]; Null, Method -> "Queued"], 
                  StandardForm]]}, {
                DynamicBox[
                 ToBoxes[
                  Button[
                  "Solve line calibration", $CellContext`a = EuclideanDistance[
                    
                    Part[$CellContext`contactcenters, \
$CellContext`calibrateimage], $CellContext`contactradius] \
($CellContext`pixelsize $CellContext`pixelbinning/$CellContext`magnification) 
                    10^(-3); $CellContext`calibratepoints = 
                    Cases[$CellContext`calibrateintensities, {
                    Round[
                    Part[
                    
                    Part[$CellContext`contactcenters, \
$CellContext`calibrateimage], 1]], 
                    Blank[], 
                    Blank[]}]; $CellContext`intensitydistances = 
                    Map[EuclideanDistance[
                    Part[#, 
                    Span[1, 2]], 
                    
                    Part[$CellContext`contactcenters, \
$CellContext`calibrateimage]] ($CellContext`pixelsize \
$CellContext`pixelbinning/$CellContext`magnification) 
                    10^(-3)& , $CellContext`calibratepoints]; \
$CellContext`hertzthickneses = $CellContext`H[$CellContext`intensitydistances]
                     10^3; $CellContext`Calibratefunction[
                    Pattern[$CellContext`x, 
                    Blank[]]] = Normal[
                    LinearModelFit[
                    Join[
                    Partition[
                    Map[Part[#, 3]& , $CellContext`calibratepoints], 1], 
                    Partition[$CellContext`hertzthickneses, 1], 2], {
                    1, $CellContext`x}, $CellContext`x]]; $CellContext`cfl[
                    Pattern[$CellContext`x, 
                    Blank[]]] = Normal[
                    $CellContext`Calibratefunction[$CellContext`x]]; \
$CellContext`linecalibrationdata = Join[
                    Partition[
                    Map[Part[#, 3]& , $CellContext`calibratepoints], 1], 
                    Partition[$CellContext`hertzthickneses, 1], 
                    2]; $CellContext`calibratedcontacts = Table[
                    Map[$CellContext`Calibratefunction, 
                    ImageData[
                    Part[
                    
                    Join[$CellContext`normalizedstatics, \
$CellContext`normalizedcontacts], $CellContext`i], "Bit16"]], {$CellContext`i, 
                    Part[
                    Dimensions[
                    
                    Join[$CellContext`normalizedstatics, \
$CellContext`normalizedcontacts]], 1]}]; Null], StandardForm]]}, {
                ButtonBox["\"Export contact images\"", ButtonFunction :> Table[
                   Export[
                    StringJoin[
                    Part[
                    
                    Join[$CellContext`staticnames, \
$CellContext`contactnames], $CellContext`i], ".eps"], 
                    Colorize[
                    Part[
                    
                    Join[$CellContext`normalizedstatics, \
$CellContext`normalizedcontacts], $CellContext`i], ColorFunction -> 
                    "Rainbow"], "eps"], {$CellContext`i, 
                    Part[
                    Dimensions[
                    
                    Join[$CellContext`normalizedstatics, \
$CellContext`normalizedcontacts]], 1]}], Method -> "Queued", Appearance -> 
                 Automatic, Evaluator -> Automatic]}, {
                ButtonBox[
                "\"Export central thickness\"", ButtonFunction :> Export[
                   StringJoin["Film thickneses", ".txt"], 
                   Join[
                    Partition[
                    ToExpression[
                    ReplaceAll[
                    
                    Join[$CellContext`staticnames, \
$CellContext`contactnames], {
                    "Static1" -> 0, "Static2" -> 0, "Static3" -> 0}]], 1], 
                    Flatten[
                    Table[
                    Map[Take[
                    Part[$CellContext`calibratedcontacts, $CellContext`i], {
                    Round[$CellContext`imagesizey/$CellContext`pixelbinning - 
                    Part[#, 2]], 
                    
                    Round[$CellContext`imagesizey/$CellContext`pixelbinning - 
                    Part[#, 2]]}, {
                    Round[
                    Part[#, 1]], 
                    Round[
                    Part[#, 1]]}]& , 
                    Part[
                    
                    Partition[$CellContext`contactcenters, 
                    1], $CellContext`i]], {$CellContext`i, 
                    Part[
                    Dimensions[$CellContext`calibratedcontacts], 1]}], 2], 2],
                    "Text"], Appearance -> Automatic, Evaluator -> Automatic, 
                 Method -> "Preemptive"]}}, 
              GridBoxAlignment -> {"Columns" -> {{Left}}, "Rows" -> {{Top}}}, 
              DefaultBaseStyle -> "Column", 
              GridBoxItemSize -> {
               "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], 
             "Column"]}}, 
          GridBoxAlignment -> {"Columns" -> {{Left}}, "Rows" -> {{Top}}}, 
          DefaultBaseStyle -> "Column", 
          GridBoxItemSize -> {
           "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], "Column"],
        DynamicBox[
         ToBoxes[
          Grid[
           Transpose[
            Partition[
             Table[
              With[{$CellContext`i = $CellContext`i}, 
               Grid[{{
                  Dynamic[
                   If[$CellContext`imageconvolution, 
                    Part[
                    $CellContext`imagecontactprocessing[
                    ImageConvolve[
                    Part[
                    
                    Join[$CellContext`normalizedstatics, \
$CellContext`normalizedcontacts], 
                    
                    Part[$CellContext`shownimages, $CellContext`i]], \
$CellContext`convolutionmatrix]], 1, 2], 
                    Part[
                    $CellContext`imagecontactprocessing[
                    Part[
                    
                    Join[$CellContext`normalizedstatics, \
$CellContext`normalizedcontacts], 
                    Part[$CellContext`shownimages, $CellContext`i]]], 1, 
                    2]]]}, {
                  Dynamic[
                   If[$CellContext`imageconvolution, 
                    Part[
                    $CellContext`imagecontactprocessing[
                    ImageConvolve[
                    Part[
                    
                    Join[$CellContext`normalizedstatics, \
$CellContext`normalizedcontacts], 
                    
                    Part[$CellContext`shownimages, $CellContext`i]], \
$CellContext`convolutionmatrix]], 1, 1], 
                    Part[
                    $CellContext`imagecontactprocessing[
                    Part[
                    
                    Join[$CellContext`normalizedstatics, \
$CellContext`normalizedcontacts], 
                    Part[$CellContext`shownimages, $CellContext`i]]], 1, 
                    1]]]}, {
                  Button["Save", Part[$CellContext`contactcenters, 
                    
                    Part[$CellContext`shownimages, $CellContext`i]] = \
$CellContext`contactcenter; Null]}}]], {$CellContext`i, 1, 
               Part[
                Dimensions[$CellContext`shownimages], 1]}], 1]]], 
          StandardForm]]},
       "Row",
       DisplayFunction->(PaneBox[
         RowBox[{
           TemplateSlotSequence[1, "\[InvisibleSpace]"]}], 
         Alignment -> {Left, Top}]& ),
       InterpretationFunction->(RowBox[{"Row", "[", 
          RowBox[{
            RowBox[{"{", 
              TemplateSlotSequence[1, ","], "}"}], ",", 
            RowBox[{"Alignment", "\[Rule]", 
              RowBox[{"{", 
                RowBox[{"Left", ",", "Top"}], "}"}]}]}], "]"}]& )]}
    },
    AutoDelete->False,
    GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Top}}},
    GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}],
   "Grid"],
  Background->RGBColor[0.85, 0.85, 0.85]]], "Output",
 CellChangeTimes->{3.641104887791016*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"LinearModelFit", "::", "notdata"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"The first argument is not a vector, matrix, or a list \
containing a design matrix and response vector. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/LinearModelFit\\\", ButtonNote -> \
\\\"LinearModelFit::notdata\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.641104928507996*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"LinearModelFit", "::", "notdata"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"The first argument is not a vector, matrix, or a list \
containing a design matrix and response vector. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/LinearModelFit\\\", ButtonNote -> \
\\\"LinearModelFit::notdata\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.641104928581915*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"LinearModelFit", "::", "notdata"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"The first argument is not a vector, matrix, or a list \
containing a design matrix and response vector. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/LinearModelFit\\\", ButtonNote -> \
\\\"LinearModelFit::notdata\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.641104928641857*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \
\[NoBreak]\\!\\(\\*StyleBox[\\(LinearModelFit :: notdata\\), \
\\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this calculation. \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/message/General/stop\\\", \
ButtonNote -> \\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.641104928648889*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"panel3", "=", 
   RowBox[{"Panel", "[", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"Column", "[", 
      RowBox[{"{", "\[IndentingNewLine]", 
       RowBox[{
        RowBox[{"Row", "[", 
         RowBox[{"{", "\[IndentingNewLine]", 
          RowBox[{"SetterBar", "[", 
           RowBox[{
            RowBox[{"Dynamic", "[", "showngraphs", "]"}], ",", 
            RowBox[{"{", 
             RowBox[{
              RowBox[{
              "1", "\[Rule]", "\"\<Film thicknesses logarithmic\>\""}], ",", 
              RowBox[{"2", "\[Rule]", "\"\<Film thicknesses linear\>\""}], 
              ",", " ", 
              RowBox[{"3", "\[Rule]", "\"\<Contact profiles\>\""}], ",", " ", 
              
              RowBox[{"4", "\[Rule]", "\"\<Calibration function\>\""}]}], 
             "}"}]}], "]"}], "\[IndentingNewLine]", "}"}], "]"}], ",", 
        "\[IndentingNewLine]", 
        RowBox[{"Row", "[", 
         RowBox[{"{", 
          RowBox[{
           RowBox[{"OpenerView", "[", 
            RowBox[{"{", 
             RowBox[{"\"\<Thicknesses setup\>\"", ",", 
              RowBox[{"Row", "[", 
               RowBox[{"{", 
                RowBox[{"\"\<Take thicknesses from average area\>\"", ",", 
                 RowBox[{"Checkbox", "[", 
                  RowBox[{"Dynamic", "[", "toggleavcft", "]"}], "]"}]}], 
                "\[IndentingNewLine]", "}"}], "]"}]}], "\[IndentingNewLine]", 
             "}"}], "]"}], ",", 
           RowBox[{"OpenerView", "[", 
            RowBox[{"{", 
             RowBox[{"\"\<Show profiles\>\"", ",", 
              RowBox[{"TogglerBar", "[", 
               RowBox[{
                RowBox[{"Dynamic", "[", "shownprofiles", "]"}], ",", 
                RowBox[{
                 RowBox[{
                  RowBox[{"(", 
                   RowBox[{"#1", "\[Rule]", "#2"}], ")"}], "&"}], "@@@", 
                 RowBox[{"Transpose", "[", 
                  RowBox[{"{", 
                   RowBox[{
                    RowBox[{"Range", "[", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", 
                    RowBox[{"Join", "[", 
                    RowBox[{"staticnames", ",", "contactnames"}], "]"}], 
                    "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", 
                    RowBox[{"Join", "[", 
                    RowBox[{"staticnames", ",", "contactnames"}], "]"}]}], 
                   "}"}], "]"}]}]}], "]"}]}], "}"}], "]"}], ",", 
           "\[IndentingNewLine]", 
           RowBox[{"OpenerView", "[", 
            RowBox[{"{", 
             RowBox[{"\"\<Profiles setup\>\"", ",", 
              RowBox[{"Column", "[", 
               RowBox[{"{", 
                RowBox[{"\"\<Profiles moving averange\>\"", ",", 
                 RowBox[{"InputField", "[", 
                  RowBox[{"Dynamic", "[", "profilesaverange", "]"}], "]"}]}], 
                "\[IndentingNewLine]", "}"}], "]"}]}], "\[IndentingNewLine]", 
             "}"}], "]"}], ",", "\[IndentingNewLine]", 
           RowBox[{"OpenerView", "[", 
            RowBox[{"{", 
             RowBox[{"\"\<Calibration function setup\>\"", ",", 
              RowBox[{"Column", "[", 
               RowBox[{"{", 
                RowBox[{
                 RowBox[{"Row", "[", 
                  RowBox[{"{", 
                   RowBox[{"\"\<Toggle line intensities\>\"", ",", 
                    RowBox[{"Checkbox", "[", 
                    RowBox[{"Dynamic", "[", "togglecli", "]"}], "]"}]}], 
                   "}"}], "]"}], ",", "\[IndentingNewLine]", 
                 RowBox[{"Row", "[", 
                  RowBox[{"{", 
                   RowBox[{"\"\<Toggle area intensities\>\"", ",", 
                    RowBox[{"Checkbox", "[", 
                    RowBox[{"Dynamic", "[", "togglecai", "]"}], "]"}]}], 
                   "}"}], "]"}], ",", "\[IndentingNewLine]", 
                 RowBox[{"Row", "[", 
                  RowBox[{"{", 
                   RowBox[{"\"\<Toggle line calibration\>\"", ",", 
                    RowBox[{"Checkbox", "[", 
                    RowBox[{"Dynamic", "[", "togglecfl", "]"}], "]"}]}], 
                   "}"}], "]"}], ",", "\[IndentingNewLine]", 
                 RowBox[{"Row", "[", 
                  RowBox[{"{", 
                   RowBox[{"\"\<Toggle area calibration\>\"", ",", 
                    RowBox[{"Checkbox", "[", 
                    RowBox[{"Dynamic", "[", "togglecfa", "]"}], "]"}]}], 
                   "}"}], "]"}]}], "\[IndentingNewLine]", "}"}], "]"}]}], 
             "\[IndentingNewLine]", "}"}], "]"}]}], "\[IndentingNewLine]", 
          "\[IndentingNewLine]", "}"}], "]"}], ",", "\[IndentingNewLine]", 
        RowBox[{
        "Manipulate", "[", "\[IndentingNewLine]", "\[IndentingNewLine]", 
         RowBox[{
          RowBox[{"Show", "[", "\[IndentingNewLine]", 
           RowBox[{
            RowBox[{"If", "[", 
             RowBox[{
              RowBox[{"showngraphs", "\[Equal]", "1"}], ",", 
              "\[IndentingNewLine]", 
              RowBox[{"{", 
               RowBox[{
                RowBox[{"cft", "=", 
                 RowBox[{"Quiet", "[", 
                  RowBox[{"Show", "[", "\[IndentingNewLine]", 
                   RowBox[{
                    RowBox[{"LogLogPlot", "[", 
                    RowBox[{
                    RowBox[{"{", "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"If", "[", 
                    RowBox[{"togglehd", ",", 
                    RowBox[{"Hc", "[", "u", "]"}]}], "]"}], ",", 
                    RowBox[{"If", "[", 
                    RowBox[{"togglehdehd", ",", 
                    RowBox[{"Hcehd", "[", "u", "]"}]}], "]"}]}], 
                    "\[IndentingNewLine]", 
                    RowBox[{"(*", 
                    RowBox[{
                    RowBox[{"Hc", "[", "u", "]"}], ",", 
                    RowBox[{"hmr", "[", "u", "]"}], ",", 
                    RowBox[{"hms", "[", "u", "]"}], ",", 
                    RowBox[{"Hcn", "[", "u", "]"}]}], "*)"}], 
                    "\[IndentingNewLine]", "}"}], " ", "\[IndentingNewLine]", 
                    ",", 
                    RowBox[{"{", 
                    RowBox[{
                    "u", ",", "theoryrangemin", ",", "theoryrangemax"}], 
                    "}"}], ",", 
                    RowBox[{"PlotRange", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"{", 
                    RowBox[{"plotrangexmin", ",", "plotrangexmax"}], "}"}], 
                    ",", 
                    RowBox[{"{", 
                    RowBox[{"plotrangeymin", ",", "plotrangeymax"}], "}"}]}], 
                    "}"}]}], ",", "\[IndentingNewLine]", 
                    RowBox[{"LabelStyle", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
                    RowBox[{"FontSize", "\[Rule]", "16"}]}], "}"}]}], ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"PlotStyle", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{"Red", ",", 
                    RowBox[{"RGBColor", "[", 
                    RowBox[{"0.88", ",", "0.61", ",", "0.14"}], "]"}], ",", 
                    RowBox[{"RGBColor", "[", 
                    RowBox[{"0.56", ",", "0.69", ",", "0.196"}], "]"}], ",", 
                    "Purple", ",", "Thick"}], "}"}]}], ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"PlotLabel", "\[Rule]", 
                    RowBox[{"Style", "[", 
                    RowBox[{"\"\<\>\"", ",", 
                    RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
                    RowBox[{"FontSize", "\[Rule]", "14"}]}], "]"}]}], ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"Frame", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{"True", ",", "True", ",", "True", ",", "True"}], 
                    "}"}]}], ",", "\[IndentingNewLine]", 
                    RowBox[{"FrameTicks", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"ticks", "[", 
                    RowBox[{
                    RowBox[{"-", "2"}], ",", "2", ",", 
                    RowBox[{"{", 
                    RowBox[{
                    "0.01", ",", "0.1", ",", "1", ",", "10", ",", "100", ",", 
                    "1000"}], "}"}]}], "]"}], ",", "Automatic"}], "}"}], ",", 
                    
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"ticks", "[", 
                    RowBox[{
                    RowBox[{"-", "2"}], ",", "2", ",", 
                    RowBox[{"{", 
                    RowBox[{
                    "0.01", ",", "0.1", ",", "1", ",", "10", ",", "100", ",", 
                    "1000"}], "}"}]}], "]"}], ",", "Automatic"}], "}"}]}], 
                    "}"}]}], ",", "\[IndentingNewLine]", 
                    RowBox[{"GridLines", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"{", 
                    RowBox[{"1", ",", "10", ",", "100"}], "}"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"0.01", ",", "0.1", ",", "1", ",", "10"}], 
                    "}"}]}], "}"}]}], ",", "\[IndentingNewLine]", 
                    RowBox[{"FrameLabel", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Style", "[", 
                    RowBox[{
                    RowBox[{"If", "[", 
                    RowBox[{"togglelabel", ",", "labelx"}], "]"}], ",", 
                    RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
                    RowBox[{"FontSize", "\[Rule]", "15"}]}], "]"}], ",", 
                    RowBox[{"Style", "[", 
                    RowBox[{
                    RowBox[{"If", "[", 
                    RowBox[{"togglelabel", ",", "labely"}], "]"}], ",", 
                    RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
                    RowBox[{"FontSize", "\[Rule]", "15"}]}], "]"}]}], "}"}]}],
                     ",", "\[IndentingNewLine]", 
                    RowBox[{"ImageSize", "\[Rule]", "imagesize"}]}], "]"}], 
                    ",", "\[IndentingNewLine]", 
                    RowBox[{"ListLogLogPlot", "[", 
                    RowBox[{"If", "[", 
                    RowBox[{"toggleavcft", ",", "\[IndentingNewLine]", 
                    RowBox[{"Join", "[", 
                    RowBox[{
                    RowBox[{"Partition", "[", 
                    RowBox[{
                    RowBox[{"ToExpression", "[", 
                    RowBox[{
                    RowBox[{"Join", "[", 
                    RowBox[{"staticnames", ",", "contactnames"}], "]"}], "/.", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"\"\<Static\>\"", "\[Rule]", "0"}], ",", 
                    RowBox[{"\"\<Static1\>\"", "\[Rule]", "0"}], ",", 
                    RowBox[{"\"\<Static2\>\"", "\[Rule]", "0"}], ",", 
                    RowBox[{"\"\<Static3\>\"", "\[Rule]", "0"}]}], "}"}]}], 
                    "]"}], ",", "1"}], "]"}], ",", 
                    RowBox[{"Table", "[", 
                    RowBox[{
                    RowBox[{"averangecentral", "[", 
                    RowBox[{
                    RowBox[{"calibratedcontacts", "[", 
                    RowBox[{"[", "i", "]"}], "]"}], ",", "cftavcircle", ",", 
                    RowBox[{"contactcenters", "[", 
                    RowBox[{"[", "i", "]"}], "]"}]}], "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"i", ",", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", "calibratedcontacts", "]"}], 
                    "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], "]"}], ",", 
                    "2"}], "]"}], ",", "\[IndentingNewLine]", 
                    RowBox[{"Join", "[", 
                    RowBox[{
                    RowBox[{"Partition", "[", 
                    RowBox[{
                    RowBox[{"ToExpression", "[", 
                    RowBox[{
                    RowBox[{"Join", "[", 
                    RowBox[{"staticnames", ",", "contactnames"}], "]"}], "/.", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"\"\<Static1\>\"", "\[Rule]", "0"}], ",", 
                    RowBox[{"\"\<Static2\>\"", "\[Rule]", "0"}], ",", 
                    RowBox[{"\"\<Static3\>\"", "\[Rule]", "0"}]}], "}"}]}], 
                    "]"}], ",", "1"}], "]"}], ",", 
                    RowBox[{"Flatten", "[", 
                    RowBox[{
                    RowBox[{"Table", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    RowBox[{"Take", "[", 
                    RowBox[{
                    RowBox[{"calibratedcontacts", "[", 
                    RowBox[{"[", "i", "]"}], "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Round", "@", 
                    RowBox[{"(", 
                    RowBox[{
                    FractionBox["imagesizey", "pixelbinning"], "-", 
                    RowBox[{"#", "[", 
                    RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}], ",", 
                    RowBox[{"Round", "@", 
                    RowBox[{"(", 
                    RowBox[{
                    FractionBox["imagesizey", "pixelbinning"], "-", 
                    RowBox[{"#", "[", 
                    RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}]}], "}"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Round", "@", 
                    RowBox[{"#", "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], ",", 
                    RowBox[{"Round", "@", 
                    RowBox[{"#", "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}]}], "}"}]}], "]"}], "&"}],
                     "/@", 
                    RowBox[{
                    RowBox[{"Partition", "[", 
                    RowBox[{"contactcenters", ",", "1"}], "]"}], "[", 
                    RowBox[{"[", "i", "]"}], "]"}]}], ",", 
                    RowBox[{"{", 
                    RowBox[{"i", ",", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", "calibratedcontacts", "]"}], 
                    "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], "]"}], ",", 
                    "2"}], "]"}], ",", "2"}], "]"}]}], "]"}], "]"}]}], 
                   "\[IndentingNewLine]", "]"}], "]"}]}], ",", 
                "\[IndentingNewLine]", 
                RowBox[{"Quiet", "[", 
                 RowBox[{"If", "[", 
                  RowBox[{"togglelegend", ",", 
                   RowBox[{"Graphics", "[", 
                    RowBox[{
                    RowBox[{"Inset", "[", 
                    RowBox[{
                    RowBox[{"plotlabel", "[", 
                    RowBox[{
                    "cft", ",", "legendheight", ",", "legendwidth", ",", 
                    "legend"}], "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", 
                    RowBox[{"Epilog", "\[Rule]", 
                    RowBox[{"PointSize", "[", "Medium", "]"}]}]}], "]"}], ",", 
                   RowBox[{"Graphics", "[", "]"}]}], "]"}], "]"}]}], "}"}], 
              ",", "\[IndentingNewLine]", 
              RowBox[{"{", "}"}]}], "\[IndentingNewLine]", "]"}], ",", 
            "\[IndentingNewLine]", 
            RowBox[{"If", "[", 
             RowBox[{
              RowBox[{"showngraphs", "\[Equal]", "2"}], ",", 
              "\[IndentingNewLine]", 
              RowBox[{"{", 
               RowBox[{
                RowBox[{"lcft", "=", 
                 RowBox[{"Quiet", "[", 
                  RowBox[{"Show", "[", "\[IndentingNewLine]", 
                   RowBox[{
                    RowBox[{"Plot", "[", 
                    RowBox[{
                    RowBox[{"{", "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"If", "[", 
                    RowBox[{"togglehd", ",", 
                    RowBox[{"Hc", "[", "u", "]"}]}], "]"}], ",", 
                    RowBox[{"If", "[", 
                    RowBox[{"togglehdehd", ",", 
                    RowBox[{"Hcehd", "[", "u", "]"}]}], "]"}]}], 
                    "\[IndentingNewLine]", 
                    RowBox[{"(*", 
                    RowBox[{
                    RowBox[{"Hc", "[", "u", "]"}], ",", 
                    RowBox[{"hmr", "[", "u", "]"}], ",", 
                    RowBox[{"hms", "[", "u", "]"}], ",", 
                    RowBox[{"Hcn", "[", "u", "]"}]}], "*)"}], 
                    "\[IndentingNewLine]", "}"}], " ", "\[IndentingNewLine]", 
                    ",", 
                    RowBox[{"{", 
                    RowBox[{
                    "u", ",", "theoryrangemin", ",", "theoryrangemax"}], 
                    "}"}], ",", 
                    RowBox[{"PlotRange", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"{", 
                    RowBox[{"plotrangexmin", ",", "plotrangexmax"}], "}"}], 
                    ",", 
                    RowBox[{"{", 
                    RowBox[{"plotrangeymin", ",", "plotrangeymax"}], "}"}]}], 
                    "}"}]}], ",", "\[IndentingNewLine]", 
                    RowBox[{"LabelStyle", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
                    RowBox[{"FontSize", "\[Rule]", "16"}]}], "}"}]}], ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"PlotStyle", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{"Red", ",", 
                    RowBox[{"RGBColor", "[", 
                    RowBox[{"0.88", ",", "0.61", ",", "0.14"}], "]"}], ",", 
                    RowBox[{"RGBColor", "[", 
                    RowBox[{"0.56", ",", "0.69", ",", "0.196"}], "]"}], ",", 
                    "Purple", ",", "Thick"}], "}"}]}], ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"PlotLabel", "\[Rule]", 
                    RowBox[{"Style", "[", 
                    RowBox[{"\"\<\>\"", ",", 
                    RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
                    RowBox[{"FontSize", "\[Rule]", "14"}]}], "]"}]}], ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"Frame", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{"True", ",", "True", ",", "True", ",", "True"}], 
                    "}"}]}], ",", "\[IndentingNewLine]", 
                    RowBox[{"GridLines", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"If", "[", 
                    RowBox[{
                    RowBox[{"plotrangexmax", "<", "500"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    "50", ",", "100", ",", "150", ",", "200", ",", "250", ",",
                     "300", ",", "350", ",", "400", ",", "450"}], "}"}], ",", 
                    
                    RowBox[{"If", "[", 
                    RowBox[{
                    RowBox[{"plotrangexmax", ">", "800"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    "200", ",", "400", ",", "600", ",", "800", ",", "1000"}], 
                    "}"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    "100", ",", "200", ",", "300", ",", "400", ",", "500", 
                    ",", "600", ",", "700", ",", "800"}], "}"}]}], "]"}]}], 
                    "]"}], ",", 
                    RowBox[{"If", "[", 
                    RowBox[{
                    RowBox[{"plotrangeymax", "<", "1.7"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    ".2", ",", ".4", ",", ".8", ",", "1", ",", "1.2", ",", 
                    "1.4", ",", "1.6"}], "}"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    "0.5", ",", "1", ",", "1.5", ",", "2", ",", "2.5", ",", 
                    "3", ",", "3.5"}], "}"}]}], "]"}]}], "}"}]}], ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"FrameLabel", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Style", "[", 
                    RowBox[{
                    RowBox[{"If", "[", 
                    RowBox[{"togglelabel", ",", "labelx"}], "]"}], ",", 
                    RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
                    RowBox[{"FontSize", "\[Rule]", "15"}]}], "]"}], ",", 
                    RowBox[{"Style", "[", 
                    RowBox[{
                    RowBox[{"If", "[", 
                    RowBox[{"togglelabel", ",", "labely"}], "]"}], ",", 
                    RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
                    RowBox[{"FontSize", "\[Rule]", "15"}]}], "]"}]}], "}"}]}],
                     ",", "\[IndentingNewLine]", 
                    RowBox[{"ImageSize", "\[Rule]", "imagesize"}]}], "]"}], 
                    ",", "\[IndentingNewLine]", 
                    RowBox[{"ListPlot", "[", 
                    RowBox[{"If", "[", 
                    RowBox[{"toggleavcft", ",", "\[IndentingNewLine]", 
                    RowBox[{"Join", "[", 
                    RowBox[{
                    RowBox[{"Partition", "[", 
                    RowBox[{
                    RowBox[{"ToExpression", "[", 
                    RowBox[{
                    RowBox[{"Join", "[", 
                    RowBox[{"staticnames", ",", "contactnames"}], "]"}], "/.", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"\"\<Static\>\"", "\[Rule]", "0"}], ",", 
                    RowBox[{"\"\<Static1\>\"", "\[Rule]", "0"}], ",", 
                    RowBox[{"\"\<Static2\>\"", "\[Rule]", "0"}], ",", 
                    RowBox[{"\"\<Static3\>\"", "\[Rule]", "0"}]}], "}"}]}], 
                    "]"}], ",", "1"}], "]"}], ",", 
                    RowBox[{"Table", "[", 
                    RowBox[{
                    RowBox[{"averangecentral", "[", 
                    RowBox[{
                    RowBox[{"calibratedcontacts", "[", 
                    RowBox[{"[", "i", "]"}], "]"}], ",", "cftavcircle", ",", 
                    RowBox[{"contactcenters", "[", 
                    RowBox[{"[", "i", "]"}], "]"}]}], "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"i", ",", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", "calibratedcontacts", "]"}], 
                    "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], "]"}], ",", 
                    "2"}], "]"}], ",", "\[IndentingNewLine]", 
                    RowBox[{"Join", "[", 
                    RowBox[{
                    RowBox[{"Partition", "[", 
                    RowBox[{
                    RowBox[{"ToExpression", "[", 
                    RowBox[{
                    RowBox[{"Join", "[", 
                    RowBox[{"staticnames", ",", "contactnames"}], "]"}], "/.", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"\"\<Static1\>\"", "\[Rule]", "0"}], ",", 
                    RowBox[{"\"\<Static2\>\"", "\[Rule]", "0"}], ",", 
                    RowBox[{"\"\<Static3\>\"", "\[Rule]", "0"}]}], "}"}]}], 
                    "]"}], ",", "1"}], "]"}], ",", 
                    RowBox[{"Flatten", "[", 
                    RowBox[{
                    RowBox[{"Table", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    RowBox[{"Take", "[", 
                    RowBox[{
                    RowBox[{"calibratedcontacts", "[", 
                    RowBox[{"[", "i", "]"}], "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Round", "@", 
                    RowBox[{"(", 
                    RowBox[{
                    FractionBox["imagesizey", "pixelbinning"], "-", 
                    RowBox[{"#", "[", 
                    RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}], ",", 
                    RowBox[{"Round", "@", 
                    RowBox[{"(", 
                    RowBox[{
                    FractionBox["imagesizey", "pixelbinning"], "-", 
                    RowBox[{"#", "[", 
                    RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}]}], "}"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Round", "@", 
                    RowBox[{"#", "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], ",", 
                    RowBox[{"Round", "@", 
                    RowBox[{"#", "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}]}], "}"}]}], "]"}], "&"}],
                     "/@", 
                    RowBox[{
                    RowBox[{"Partition", "[", 
                    RowBox[{"contactcenters", ",", "1"}], "]"}], "[", 
                    RowBox[{"[", "i", "]"}], "]"}]}], ",", 
                    RowBox[{"{", 
                    RowBox[{"i", ",", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", "calibratedcontacts", "]"}], 
                    "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], "]"}], ",", 
                    "2"}], "]"}], ",", "2"}], "]"}]}], "]"}], "]"}]}], 
                   "\[IndentingNewLine]", "]"}], "]"}]}], ",", 
                "\[IndentingNewLine]", 
                RowBox[{"Quiet", "[", 
                 RowBox[{"If", "[", 
                  RowBox[{"togglelegend", ",", 
                   RowBox[{"Graphics", "[", 
                    RowBox[{
                    RowBox[{"Inset", "[", 
                    RowBox[{
                    RowBox[{"plotlabel", "[", 
                    RowBox[{
                    "lcft", ",", "legendheight", ",", "legendwidth", ",", 
                    "legend"}], "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", 
                    RowBox[{"Epilog", "\[Rule]", 
                    RowBox[{"PointSize", "[", "Medium", "]"}]}]}], "]"}], ",", 
                   RowBox[{"Graphics", "[", "]"}]}], "]"}], "]"}]}], "}"}], 
              ",", "\[IndentingNewLine]", 
              RowBox[{"{", "}"}]}], "\[IndentingNewLine]", "]"}], ",", 
            "\[IndentingNewLine]", 
            RowBox[{"If", "[", 
             RowBox[{
              RowBox[{"showngraphs", "\[Equal]", "3"}], ",", 
              "\[IndentingNewLine]", 
              RowBox[{"{", 
               RowBox[{
                RowBox[{"cpro", "=", 
                 RowBox[{"Quiet", "[", 
                  RowBox[{"Show", "[", "\[IndentingNewLine]", 
                   RowBox[{
                    RowBox[{"Plot", "[", 
                    RowBox[{
                    RowBox[{"{", "}"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    "u", ",", "theoryrangemin", ",", "theoryrangemax"}], 
                    "}"}], ",", "\[IndentingNewLine]", 
                    RowBox[{"PlotRange", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"{", 
                    RowBox[{"plotrangexmin", ",", "plotrangexmax"}], "}"}], 
                    ",", 
                    RowBox[{"{", 
                    RowBox[{"plotrangeymin", ",", "plotrangeymax"}], "}"}]}], 
                    "}"}]}], ",", "\[IndentingNewLine]", 
                    RowBox[{"LabelStyle", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
                    RowBox[{"FontSize", "\[Rule]", "16"}]}], "}"}]}], ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"PlotLabel", "\[Rule]", 
                    RowBox[{"Style", "[", 
                    RowBox[{"\"\<\>\"", ",", 
                    RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
                    RowBox[{"FontSize", "\[Rule]", "14"}]}], "]"}]}], ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"Frame", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{"True", ",", "True", ",", "True", ",", "True"}], 
                    "}"}]}], ",", "\[IndentingNewLine]", 
                    RowBox[{"GridLines", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"-", ".8"}], ",", 
                    RowBox[{"-", ".6"}], ",", 
                    RowBox[{"-", ".4"}], ",", 
                    RowBox[{"-", ".2"}], ",", ".2", ",", ".4", ",", ".6", ",",
                     ".8"}], "}"}], ",", 
                    RowBox[{"If", "[", 
                    RowBox[{
                    RowBox[{"plotrangeymax", "<", "1.7"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    ".2", ",", ".4", ",", ".6", ",", ".8", ",", "1", ",", 
                    "1.2", ",", "1.4", ",", "1.6"}], "}"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    "0.5", ",", "1", ",", "1.5", ",", "2", ",", "2.5", ",", 
                    "3", ",", "3.5"}], "}"}]}], "]"}]}], "}"}]}], ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"FrameLabel", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Style", "[", 
                    RowBox[{
                    RowBox[{"If", "[", 
                    RowBox[{"togglelabel", ",", "labelx"}], "]"}], ",", 
                    RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
                    RowBox[{"FontSize", "\[Rule]", "15"}]}], "]"}], ",", 
                    RowBox[{"Style", "[", 
                    RowBox[{
                    RowBox[{"If", "[", 
                    RowBox[{"togglelabel", ",", "labely"}], "]"}], ",", 
                    RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
                    RowBox[{"FontSize", "\[Rule]", "15"}]}], "]"}]}], "}"}]}],
                     ",", "\[IndentingNewLine]", 
                    RowBox[{"ImageSize", "\[Rule]", "imagesize"}]}], "]"}], 
                    ",", "\[IndentingNewLine]", 
                    RowBox[{"ListPlot", "[", 
                    RowBox[{
                    RowBox[{"Table", "[", "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"Join", "[", "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{"Partition", "[", "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"Round", "@", 
                    RowBox[{"MovingAverage", "[", "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"Range", "[", 
                    FractionBox["imagesizex", "pixelbinning"], "]"}], "-", 
                    RowBox[{
                    RowBox[{"Round", "[", 
                    RowBox[{"contactcenters", "[", 
                    RowBox[{"[", "i", "]"}], "]"}], "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], ",", 
                    "profilesaverange"}], "]"}]}], 
                    FractionBox[
                    RowBox[{"pixelsize", " ", "pixelbinning", " ", 
                    SuperscriptBox["10", 
                    RowBox[{"-", "3"}]]}], "magnification"]}], ",", "1"}], 
                    "]"}], ",", "\[IndentingNewLine]", 
                    RowBox[{"Part", "[", "\[IndentingNewLine]", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    RowBox[{"Partition", "[", 
                    RowBox[{"#", ",", "1"}], "]"}], "&"}], "/@", 
                    RowBox[{"(", 
                    RowBox[{
                    RowBox[{
                    RowBox[{"MovingAverage", "[", 
                    RowBox[{"#", ",", "profilesaverange"}], "]"}], "&"}], "/@", 
                    RowBox[{"Flatten", "[", 
                    RowBox[{
                    RowBox[{"Table", "[", 
                    RowBox[{
                    RowBox[{
                    RowBox[{
                    RowBox[{"Take", "[", 
                    RowBox[{
                    RowBox[{"calibratedcontacts", "[", 
                    RowBox[{"[", "i", "]"}], "]"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Round", "@", 
                    RowBox[{"(", 
                    RowBox[{
                    FractionBox["imagesizey", "pixelbinning"], "-", 
                    RowBox[{"#", "[", 
                    RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}], ",", 
                    RowBox[{"Round", "@", 
                    RowBox[{"(", 
                    RowBox[{
                    FractionBox["imagesizey", "pixelbinning"], "-", 
                    RowBox[{"#", "[", 
                    RowBox[{"[", "2", "]"}], "]"}]}], ")"}]}]}], "}"}], ",", 
                    RowBox[{"{", 
                    RowBox[{"1", ",", 
                    FractionBox["imagesizex", "pixelbinning"]}], "}"}]}], 
                    "]"}], "&"}], "/@", 
                    RowBox[{
                    RowBox[{"Partition", "[", 
                    RowBox[{"contactcenters", ",", "1"}], "]"}], "[", 
                    RowBox[{"[", "i", "]"}], "]"}]}], ",", 
                    RowBox[{"{", 
                    RowBox[{"i", ",", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", "calibratedcontacts", "]"}], 
                    "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], "]"}], ",", 
                    "2"}], "]"}]}], ")"}]}], ",", "\[IndentingNewLine]", 
                    "i"}], "]"}], ",", "\[IndentingNewLine]", "2"}], "]"}], 
                    ",", "\[IndentingNewLine]", 
                    RowBox[{"{", 
                    RowBox[{"i", ",", 
                    RowBox[{
                    RowBox[{"Dimensions", "[", "calibratedcontacts", "]"}], 
                    "[", 
                    RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], 
                    "\[IndentingNewLine]", "]"}], "[", 
                    RowBox[{"[", "shownprofiles", "]"}], "]"}], 
                    "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", 
                   "]"}], "]"}]}], ",", "\[IndentingNewLine]", 
                RowBox[{"Quiet", "[", 
                 RowBox[{"If", "[", 
                  RowBox[{"togglelegend", ",", 
                   RowBox[{"Graphics", "[", 
                    RowBox[{
                    RowBox[{"Inset", "[", 
                    RowBox[{
                    RowBox[{"plotlabel", "[", 
                    RowBox[{
                    "cpro", ",", "legendheight", ",", "legendwidth", ",", 
                    "legend"}], "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", 
                    RowBox[{"Epilog", "\[Rule]", 
                    RowBox[{"PointSize", "[", "Medium", "]"}]}]}], "]"}], ",", 
                   RowBox[{"Graphics", "[", "]"}]}], "]"}], "]"}]}], "}"}], 
              "\[IndentingNewLine]", ",", 
              RowBox[{"{", "}"}]}], "]"}], ",", "\[IndentingNewLine]", 
            RowBox[{"If", "[", 
             RowBox[{
              RowBox[{"showngraphs", "\[Equal]", "4"}], ",", 
              "\[IndentingNewLine]", 
              RowBox[{"{", 
               RowBox[{
                RowBox[{"calin", "=", 
                 RowBox[{"Quiet", "[", 
                  RowBox[{"Show", "[", "\[IndentingNewLine]", 
                   RowBox[{
                    RowBox[{"Plot", "[", 
                    RowBox[{
                    RowBox[{"{", "}"}], " ", ",", "\[IndentingNewLine]", 
                    RowBox[{"{", 
                    RowBox[{
                    "u", ",", "theoryrangemin", ",", "theoryrangemax"}], 
                    "}"}], ",", "\[IndentingNewLine]", 
                    RowBox[{"PlotRange", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"{", 
                    RowBox[{"plotrangexmin", ",", "plotrangexmax"}], "}"}], 
                    ",", 
                    RowBox[{"{", 
                    RowBox[{"plotrangeymin", ",", "plotrangeymax"}], "}"}]}], 
                    "}"}]}], ",", "\[IndentingNewLine]", 
                    RowBox[{"LabelStyle", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
                    RowBox[{"FontSize", "\[Rule]", "16"}]}], "}"}]}], ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"PlotLabel", "\[Rule]", 
                    RowBox[{"Style", "[", 
                    RowBox[{"\"\<\>\"", ",", 
                    RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
                    RowBox[{"FontSize", "\[Rule]", "14"}]}], "]"}]}], ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"Frame", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{"True", ",", "True", ",", "True", ",", "True"}], 
                    "}"}]}], ",", "\[IndentingNewLine]", 
                    RowBox[{"GridLines", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"{", 
                    RowBox[{
                    "10000", ",", "20000", ",", "30000", ",", "40000", ",", 
                    "50000", ",", "60000"}], "}"}], ",", 
                    RowBox[{"If", "[", 
                    RowBox[{
                    RowBox[{"plotrangeymax", "<", "1.7"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    ".2", ",", ".4", ",", ".8", ",", "1", ",", "1.2", ",", 
                    "1.4", ",", "1.6"}], "}"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    "0.5", ",", "1", ",", "1.5", ",", "2", ",", "2.5", ",", 
                    "3", ",", "3.5"}], "}"}]}], "]"}]}], "}"}]}], ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"FrameLabel", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Style", "[", 
                    RowBox[{
                    RowBox[{"If", "[", 
                    RowBox[{"togglelabel", ",", "labelx"}], "]"}], ",", 
                    RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
                    RowBox[{"FontSize", "\[Rule]", "15"}]}], "]"}], ",", 
                    RowBox[{"Style", "[", 
                    RowBox[{
                    RowBox[{"If", "[", 
                    RowBox[{"togglelabel", ",", "labely"}], "]"}], ",", 
                    RowBox[{"FontFamily", "\[Rule]", "\"\<Verdana\>\""}], ",", 
                    RowBox[{"FontSize", "\[Rule]", "15"}]}], "]"}]}], 
                    "}"}]}]}], "]"}], "\[IndentingNewLine]", ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"ListPlot", "[", 
                    RowBox[{"If", "[", 
                    RowBox[{"togglecai", ",", "areacalibrationdata", ",", 
                    RowBox[{"{", "}"}]}], "]"}], "]"}], ",", 
                    "\[IndentingNewLine]", 
                    RowBox[{"ListPlot", "[", 
                    RowBox[{
                    RowBox[{"If", "[", 
                    RowBox[{"togglecli", ",", "linecalibrationdata", ",", 
                    RowBox[{"{", "}"}]}], "]"}], ",", 
                    RowBox[{"PlotStyle", "\[Rule]", 
                    RowBox[{"RGBColor", "[", 
                    RowBox[{"0.88", ",", "0.61", ",", "0.14"}], "]"}]}]}], 
                    "]"}], ",", "\[IndentingNewLine]", 
                    RowBox[{"Plot", "[", 
                    RowBox[{
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"If", "[", 
                    RowBox[{"togglecfa", ",", 
                    RowBox[{"cfa", "[", "u", "]"}]}], "]"}], ",", 
                    RowBox[{"If", "[", 
                    RowBox[{"togglecfl", ",", 
                    RowBox[{"cfl", "[", "u", "]"}]}], "]"}]}], "}"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    "u", ",", "theoryrangemin", ",", "theoryrangemax"}], 
                    "}"}], ",", 
                    RowBox[{"PlotStyle", "\[Rule]", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Thickness", "[", "0.008", "]"}], ",", "Red"}], 
                    "}"}], ",", 
                    RowBox[{"{", 
                    RowBox[{
                    RowBox[{"Thickness", "[", "0.0065", "]"}], ",", 
                    RowBox[{"RGBColor", "[", 
                    RowBox[{"0.56", ",", "0.69", ",", "0.196"}], "]"}]}], 
                    "}"}]}], "}"}]}]}], "]"}]}], "\[IndentingNewLine]", 
                   "\[IndentingNewLine]", "]"}], "]"}]}], ",", 
                "\[IndentingNewLine]", 
                RowBox[{"Quiet", "[", 
                 RowBox[{"If", "[", 
                  RowBox[{"togglelegend", ",", 
                   RowBox[{"Graphics", "[", 
                    RowBox[{
                    RowBox[{"Inset", "[", 
                    RowBox[{
                    RowBox[{"plotlabel", "[", 
                    RowBox[{
                    "calin", ",", "legendheight", ",", "legendwidth", ",", 
                    "legend"}], "]"}], "[", 
                    RowBox[{"[", "1", "]"}], "]"}], "]"}], ",", 
                    RowBox[{"Epilog", "\[Rule]", 
                    RowBox[{"PointSize", "[", "Medium", "]"}]}]}], "]"}], ",", 
                   RowBox[{"Graphics", "[", "]"}]}], "]"}], "]"}]}], "}"}], 
              ",", "\[IndentingNewLine]", 
              RowBox[{"{", "}"}]}], "\[IndentingNewLine]", "]"}]}], 
           "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]", ",", 
          "\[IndentingNewLine]", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{
             "theoryrangemin", ",", "1", ",", "\"\<Theory range min\>\""}], 
             "}"}], ",", "0", ",", "1500", ",", "0.1", ",", 
            RowBox[{"ControlType", "\[Rule]", "InputField"}]}], "}"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{
             "theoryrangemax", ",", "800", ",", "\"\<Theory range min\>\""}], 
             "}"}], ",", "0", ",", "1500", ",", "0.1", ",", 
            RowBox[{"ControlType", "\[Rule]", "InputField"}]}], "}"}], ",", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{
             "plotrangexmin", ",", "0.1", ",", "\"\<Plot range X min\>\""}], 
             "}"}], ",", "0", ",", "1500", ",", "10", ",", 
            RowBox[{"ControlType", "\[Rule]", "InputField"}]}], "}"}], ",", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{
             "plotrangexmax", ",", "1000", ",", "\"\<Plot range X max\>\""}], 
             "}"}], ",", "0", ",", "1500", ",", "0.1", ",", 
            RowBox[{"ControlType", "\[Rule]", "InputField"}]}], "}"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{
             "plotrangeymin", ",", "0.01", ",", "\"\<Plot range Y min\>\""}], 
             "}"}], ",", "0", ",", "1500", ",", "10", ",", 
            RowBox[{"ControlType", "\[Rule]", "InputField"}]}], "}"}], ",", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{
             "plotrangeymax", ",", "100", ",", "\"\<Plot range Y max\>\""}], 
             "}"}], ",", "0", ",", "1500", ",", "0.1", ",", 
            RowBox[{"ControlType", "\[Rule]", "InputField"}]}], "}"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{"imagesize", ",", "350", ",", "\"\<Image size\>\""}], 
             "}"}], ",", "0", ",", "2000", ",", "0.1", ",", 
            RowBox[{"ControlType", "\[Rule]", "InputField"}]}], "}"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{"togglelabel", ",", "False", ",", "\"\<Label\>\""}], 
             "}"}], ",", 
            RowBox[{"{", 
             RowBox[{"True", ",", "False"}], "}"}]}], "}"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{"labelx", ",", ",", "\"\<Label X\>\""}], "}"}], ",", ",", 
            RowBox[{"ControlType", "\[Rule]", "InputField"}]}], "}"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{"labely", ",", ",", "\"\<Label Y\>\""}], "}"}], ",", ",", 
            RowBox[{"ControlType", "\[Rule]", "InputField"}]}], "}"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{"togglelegend", ",", "False", ",", "\"\<Legend\>\""}], 
             "}"}], ",", 
            RowBox[{"{", 
             RowBox[{"True", ",", "False"}], "}"}]}], "}"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{"legendwidth", ",", "100", ",", "\"\<Legen width\>\""}], 
             "}"}], ",", "0", ",", "300", ",", "0.1", ",", 
            RowBox[{"ControlType", "\[Rule]", "InputField"}]}], "}"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{
             "legendheight", ",", "30", ",", "\"\<Legend height\>\""}], "}"}],
             ",", "0", ",", "300", ",", "0.1", ",", 
            RowBox[{"ControlType", "\[Rule]", "InputField"}]}], "}"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{"legend", ",", ",", "\"\<Legend\>\""}], "}"}], ",", ",", 
            
            RowBox[{"ControlType", "\[Rule]", "InputField"}]}], "}"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{
             "togglehd", ",", "True", ",", "\"\<Hammrock&Dowson I-EHD\>\""}], 
             "}"}], ",", 
            RowBox[{"{", 
             RowBox[{"True", ",", "False"}], "}"}]}], "}"}], ",", 
          "\[IndentingNewLine]", 
          RowBox[{"{", 
           RowBox[{
            RowBox[{"{", 
             RowBox[{
             "togglehdehd", ",", "False", ",", 
              "\"\<Hammrock&Dowson EHD\>\""}], "}"}], ",", 
            RowBox[{"{", 
             RowBox[{"True", ",", "False"}], "}"}]}], "}"}]}], 
         "\[IndentingNewLine]", "\[IndentingNewLine]", "]"}]}], 
       "\[IndentingNewLine]", "}"}], "]"}], "\[IndentingNewLine]", ",", 
     RowBox[{"Background", "\[Rule]", 
      RowBox[{"RGBColor", "[", 
       RowBox[{"0.85", ",", "0.85", ",", "0.85"}], "]"}]}]}], "]"}]}], 
  "\[IndentingNewLine]", "\[IndentingNewLine]"}]], "Input",
 CellChangeTimes->{{3.633080493878055*^9, 3.633080525764988*^9}, {
   3.6330805663829308`*^9, 3.63308062875731*^9}, {3.633081273786271*^9, 
   3.6330813056782017`*^9}, {3.633081434321665*^9, 3.63308148903273*^9}, {
   3.633088635832613*^9, 3.633088653472866*^9}, {3.633088835318058*^9, 
   3.6330888412581882`*^9}, {3.633088976712895*^9, 3.63308901673702*^9}, {
   3.633353046602837*^9, 3.633353075530797*^9}, {3.633353120706601*^9, 
   3.6333531485642138`*^9}, {3.633686441723445*^9, 3.633686456101199*^9}, {
   3.63369678937689*^9, 3.6336968015167522`*^9}, {3.6336969020719757`*^9, 
   3.6336970341856956`*^9}, {3.633700451982279*^9, 3.633700453233367*^9}, {
   3.63370349415263*^9, 3.633703513667316*^9}, {3.633703556593158*^9, 
   3.633703558417733*^9}, {3.633703621955777*^9, 3.633703678838822*^9}, {
   3.633703776587487*^9, 3.633703840980595*^9}, {3.633703876867312*^9, 
   3.633703885182866*^9}, {3.634320932826015*^9, 3.634320945919991*^9}, {
   3.634321333735894*^9, 3.634321380273562*^9}, {3.634321414959466*^9, 
   3.6343215843979263`*^9}, {3.634321737971332*^9, 3.63432176778813*^9}, {
   3.634322963663259*^9, 3.634322972647935*^9}, 3.634323471134881*^9, {
   3.634353914966421*^9, 3.634353916223125*^9}, {3.634827944991023*^9, 
   3.6348279518137903`*^9}, {3.634828078382741*^9, 3.634828112172701*^9}, 
   3.634828349643512*^9, 3.635405312636056*^9, 3.635405755362158*^9, {
   3.6354058025691566`*^9, 3.635405873425061*^9}, {3.635405965312958*^9, 
   3.6354060331730003`*^9}, {3.635406116538671*^9, 3.6354061252911263`*^9}, {
   3.6354061782940283`*^9, 3.635406230121105*^9}, {3.6354062701332073`*^9, 
   3.6354062821433*^9}, {3.635406318918928*^9, 3.6354063301008883`*^9}, {
   3.635406362428052*^9, 3.635406363803356*^9}, {3.63540706010944*^9, 
   3.635407175497426*^9}, {3.635407322407402*^9, 3.6354073927042303`*^9}, {
   3.6354074253789673`*^9, 3.635407545965332*^9}, {3.635407584854238*^9, 
   3.635407590334652*^9}, {3.635407944098571*^9, 3.635407972016838*^9}, {
   3.6354080082334633`*^9, 3.635408069132216*^9}, {3.63540810421154*^9, 
   3.6354081055942183`*^9}, {3.635426195479003*^9, 3.635426209816374*^9}, {
   3.635426319415059*^9, 3.635426330637191*^9}, {3.635426942245356*^9, 
   3.635426943243587*^9}, {3.635427030474276*^9, 3.635427034195648*^9}, {
   3.635427143344133*^9, 3.635427154231262*^9}, {3.635427189776544*^9, 
   3.635427228088154*^9}, {3.635427400798476*^9, 3.6354274266310453`*^9}, {
   3.635427477850032*^9, 3.635427479144709*^9}, {3.635427539974139*^9, 
   3.635427542573689*^9}, {3.635427629966608*^9, 3.6354276382762213`*^9}, {
   3.635427668529665*^9, 3.6354276944078407`*^9}, {3.6354277766351967`*^9, 
   3.635427849204612*^9}, {3.635427894727723*^9, 3.6354279878844213`*^9}, {
   3.635428057751746*^9, 3.635428074273868*^9}, {3.635428109716322*^9, 
   3.635428175354412*^9}, {3.635435517403022*^9, 3.635435530784783*^9}, {
   3.635440295253832*^9, 3.635440325939723*^9}, {3.635440374502615*^9, 
   3.635440383061702*^9}, {3.6354404181759*^9, 3.635440418285071*^9}, {
   3.635440470923009*^9, 3.635440470991159*^9}, {3.635440544452894*^9, 
   3.635440575936832*^9}, {3.63544060731284*^9, 3.6354406225410957`*^9}, {
   3.635442259877466*^9, 3.635442268521188*^9}, {3.635442331124591*^9, 
   3.635442349204331*^9}, 3.635442427561864*^9, {3.635442486452286*^9, 
   3.635442532946823*^9}, {3.635442713133314*^9, 3.635442746281114*^9}, {
   3.635442805460787*^9, 3.635442838262645*^9}, {3.635442890576995*^9, 
   3.635442896856154*^9}, {3.635442990245124*^9, 3.635443018970168*^9}, {
   3.635443061722067*^9, 3.635443113600214*^9}, {3.635443167672496*^9, 
   3.635443169392253*^9}, 3.635443205675934*^9, {3.635443236175254*^9, 
   3.635443237799075*^9}, {3.635443565082971*^9, 3.635443683484889*^9}, {
   3.635443735399411*^9, 3.63544375961971*^9}, {3.635443809762225*^9, 
   3.635443811915547*^9}, {3.6354444313069153`*^9, 3.6354444336175413`*^9}, {
   3.635444748177841*^9, 3.635444767266226*^9}, 3.635444934756179*^9, {
   3.635444994587782*^9, 3.635444999583343*^9}, {3.63544503383911*^9, 
   3.635445034420064*^9}, {3.635445103720292*^9, 3.635445238221427*^9}, {
   3.635445278134924*^9, 3.635445334181016*^9}, {3.6354454061856956`*^9, 
   3.63544544401208*^9}, {3.6354455407514067`*^9, 3.6354455643195047`*^9}, {
   3.6354457259794817`*^9, 3.6354457331177683`*^9}, {3.635445872037672*^9, 
   3.6354459739466963`*^9}, 3.635446060864839*^9, 3.635446097501896*^9, {
   3.6354461484157887`*^9, 3.6354461658714647`*^9}, 3.6354463074298143`*^9, {
   3.6354464541260033`*^9, 3.635446481658827*^9}, {3.63544656818519*^9, 
   3.635446568374002*^9}, {3.635446602129507*^9, 3.6354466459711*^9}, {
   3.635446718848917*^9, 3.635446720945512*^9}, {3.635446794757991*^9, 
   3.635446842853808*^9}, {3.635446878961589*^9, 3.635446909625827*^9}, {
   3.635447183151875*^9, 3.635447187205649*^9}, {3.6354472314180517`*^9, 
   3.635447232613372*^9}, {3.635447348131864*^9, 3.635447356547392*^9}, {
   3.635447450357068*^9, 3.635447490862391*^9}, {3.635447523388256*^9, 
   3.6354475453542833`*^9}, {3.635447648471098*^9, 3.635447676693803*^9}, {
   3.63544781534651*^9, 3.635447833384191*^9}, {3.635447951011388*^9, 
   3.6354479917824287`*^9}, {3.6354480711878653`*^9, 3.635448077955986*^9}, {
   3.635448149095191*^9, 3.635448179389699*^9}, {3.6354482381131973`*^9, 
   3.635448252658347*^9}, {3.63544849346319*^9, 3.635448496260947*^9}, {
   3.635448602803255*^9, 3.635448647864369*^9}, {3.6354486780946283`*^9, 
   3.6354486900277843`*^9}, {3.6354487832863197`*^9, 3.635448807064311*^9}, {
   3.635448874018969*^9, 3.6354488985590563`*^9}, {3.635448947856262*^9, 
   3.63544896246414*^9}, {3.635449087389802*^9, 3.635449121500278*^9}, {
   3.635449155240491*^9, 3.635449202902232*^9}, {3.635449250902389*^9, 
   3.635449271039209*^9}, {3.635449324299848*^9, 3.635449506607031*^9}, {
   3.6354495513159103`*^9, 3.635449551651905*^9}, {3.635449653750105*^9, 
   3.635449666541634*^9}, {3.6354804166228123`*^9, 3.6354804752943687`*^9}, {
   3.635483174706159*^9, 3.635483176739291*^9}, {3.635483405984145*^9, 
   3.635483493404608*^9}, {3.635483537697322*^9, 3.635483565253199*^9}, 
   3.635483784116987*^9, {3.635484031392301*^9, 3.63548405645362*^9}, {
   3.6354841529231243`*^9, 3.6354842180000772`*^9}, {3.6354842735618687`*^9, 
   3.635484274276217*^9}, {3.635484334370287*^9, 3.6354843369764843`*^9}, {
   3.635484405225245*^9, 3.6354844183667507`*^9}, {3.6356668076904573`*^9, 
   3.6356668345376177`*^9}, {3.6356669094764547`*^9, 3.635667002094589*^9}, {
   3.635667078668972*^9, 3.6356671290329437`*^9}, {3.635667248129491*^9, 
   3.6356672931506453`*^9}, {3.6356673486637297`*^9, 
   3.6356674263942947`*^9}, {3.63566755003369*^9, 3.6356676465667133`*^9}, {
   3.635667683635063*^9, 3.635667697487602*^9}, {3.6356684065086184`*^9, 
   3.6356684096520147`*^9}, {3.63566848500095*^9, 3.635668485342977*^9}, {
   3.635668687195951*^9, 3.6356686969132566`*^9}, {3.6356687708100224`*^9, 
   3.635668790263382*^9}, {3.63575317516682*^9, 3.63575321802919*^9}, {
   3.635753255944749*^9, 3.635753297888021*^9}, {3.635753340583905*^9, 
   3.635753368757412*^9}, {3.635753434764702*^9, 3.63575344647987*^9}, {
   3.6357539681956367`*^9, 3.6357540327287617`*^9}, 3.6357541027390614`*^9, {
   3.635757324248625*^9, 3.6357573957126703`*^9}, {3.635757434506008*^9, 
   3.6357574367387123`*^9}, {3.641109966305072*^9, 3.641109967169174*^9}}],

Cell[BoxData[
 PanelBox[
  TagBox[GridBox[{
     {
      TemplateBox[{InterpretationBox[
         StyleBox[
          GridBox[{{
             SetterBox[
              Dynamic[$CellContext`showngraphs], {1}, 
              "\"Film thicknesses logarithmic\""], 
             SetterBox[
              Dynamic[$CellContext`showngraphs], {2}, 
              "\"Film thicknesses linear\""], 
             SetterBox[
              Dynamic[$CellContext`showngraphs], {3}, "\"Contact profiles\""], 
             SetterBox[
              Dynamic[$CellContext`showngraphs], {4}, 
              "\"Calibration function\""]}}, ColumnSpacings -> 0, 
           BaselinePosition -> {1, 1}], Deployed -> True], 
         SetterBar[
          Dynamic[$CellContext`showngraphs], {
          1 -> "Film thicknesses logarithmic", 2 -> "Film thicknesses linear",
            3 -> "Contact profiles", 4 -> "Calibration function"}]]},
       "RowDefault"]},
     {
      TemplateBox[{TagBox[
         DynamicModuleBox[{Typeset`var$$ = False}, 
          InterpretationBox[
           StyleBox[
            PaneSelectorBox[{False -> GridBox[{{
                  OpenerBox[
                   Dynamic[Typeset`var$$], Appearance -> Automatic, 
                   AutoAction -> False, ContinuousAction -> False, Enabled -> 
                   Automatic], "\"Thicknesses setup\""}}, AutoDelete -> False,
                 BaselinePosition -> {1, 1}, 
                GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                GridBoxBackground -> {"Columns" -> {{Automatic}}}, 
                GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {"Columns" -> {{0.2}}, "Rows" -> {{0.5}}}],
               True -> GridBox[{{
                  OpenerBox[
                   Dynamic[Typeset`var$$], Appearance -> Automatic, 
                   AutoAction -> False, ContinuousAction -> False, Enabled -> 
                   Automatic], "\"Thicknesses setup\""}, {"", 
                  PaneBox[
                   TemplateBox[{"\"Take thicknesses from average area\"", 
                    CheckboxBox[
                    Dynamic[$CellContext`toggleavcft]]}, "RowDefault"], 
                   ImageMargins -> 0]}}, AutoDelete -> False, 
                BaselinePosition -> {1, 1}, 
                GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                GridBoxBackground -> {"Columns" -> {{Automatic}}}, 
                GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {
                 "Columns" -> {{0.2}}, "Rows" -> {{0.5}}}]}, 
             Dynamic[Typeset`var$$], Alignment -> Automatic, BaselinePosition -> 
             Baseline, DefaultBaseStyle -> "OpenerView", ImageMargins -> 0, 
             ImageSize -> Automatic], Deployed -> False, StripOnInput -> 
            False], 
           OpenerView[{"Thicknesses setup", 
             Row[{"Take thicknesses from average area", 
               Checkbox[
                Dynamic[$CellContext`toggleavcft]]}]}, False]], 
          DynamicModuleValues :> {}], Setting[#, {0}]& ],TagBox[
         DynamicModuleBox[{Typeset`var$$ = False}, 
          InterpretationBox[
           StyleBox[
            PaneSelectorBox[{False -> GridBox[{{
                  OpenerBox[
                   Dynamic[Typeset`var$$], Appearance -> Automatic, 
                   AutoAction -> False, ContinuousAction -> False, Enabled -> 
                   Automatic], "\"Show profiles\""}}, AutoDelete -> False, 
                BaselinePosition -> {1, 1}, 
                GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                GridBoxBackground -> {"Columns" -> {{Automatic}}}, 
                GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {"Columns" -> {{0.2}}, "Rows" -> {{0.5}}}],
               True -> GridBox[{{
                  OpenerBox[
                   Dynamic[Typeset`var$$], Appearance -> Automatic, 
                   AutoAction -> False, ContinuousAction -> False, Enabled -> 
                   Automatic], "\"Show profiles\""}, {"", 
                  PaneBox[
                   InterpretationBox[
                    StyleBox[
                    GridBox[{{
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 1], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    1]& ], {True}, "\"Static\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 2], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    2]& ], {True}, "\"100\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 3], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    3]& ], {True}, "\"10\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 4], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    4]& ], {True}, "\"150\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 5], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    5]& ], {True}, "\"200\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 6], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    6]& ], {True}, "\"20\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 7], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    7]& ], {True}, "\"300\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 8], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    8]& ], {True}, "\"400\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 9], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    9]& ], {True}, "\"40\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 10], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    10]& ], {True}, "\"500\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 11], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    11]& ], {True}, "\"5\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 12], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    12]& ], {True}, "\"60\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 13], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    13]& ], {True}, "\"80\""]}}, BaselinePosition -> {1, 1}, 
                    GridBoxSpacings -> {"Columns" -> {
                    Offset[0.27999999999999997`], {
                    Offset[0.]}, 
                    Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, 
                    "Rows" -> {
                    Offset[0.2], {
                    Offset[0.4]}, 
                    Offset[0.2]}, "RowsIndexed" -> {}}], Deployed -> True], 
                    TogglerBar[
                    Dynamic[$CellContext`shownprofiles], {
                    1 -> "Static", 2 -> "100", 3 -> "10", 4 -> "150", 5 -> 
                    "200", 6 -> "20", 7 -> "300", 8 -> "400", 9 -> "40", 10 -> 
                    "500", 11 -> "5", 12 -> "60", 13 -> "80"}]], ImageMargins -> 
                   0]}}, AutoDelete -> False, BaselinePosition -> {1, 1}, 
                GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                GridBoxBackground -> {"Columns" -> {{Automatic}}}, 
                GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {
                 "Columns" -> {{0.2}}, "Rows" -> {{0.5}}}]}, 
             Dynamic[Typeset`var$$], Alignment -> Automatic, BaselinePosition -> 
             Baseline, DefaultBaseStyle -> "OpenerView", ImageMargins -> 0, 
             ImageSize -> Automatic], Deployed -> False, StripOnInput -> 
            False], 
           OpenerView[{"Show profiles", 
             TogglerBar[
              Dynamic[$CellContext`shownprofiles], {
              1 -> "Static", 2 -> "100", 3 -> "10", 4 -> "150", 5 -> "200", 6 -> 
               "20", 7 -> "300", 8 -> "400", 9 -> "40", 10 -> "500", 11 -> 
               "5", 12 -> "60", 13 -> "80"}]}, False]], 
          DynamicModuleValues :> {}], Setting[#, {0}]& ],TagBox[
         DynamicModuleBox[{Typeset`var$$ = False}, 
          InterpretationBox[
           StyleBox[
            PaneSelectorBox[{False -> GridBox[{{
                  OpenerBox[
                   Dynamic[Typeset`var$$], Appearance -> Automatic, 
                   AutoAction -> False, ContinuousAction -> False, Enabled -> 
                   Automatic], "\"Profiles setup\""}}, AutoDelete -> False, 
                BaselinePosition -> {1, 1}, 
                GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                GridBoxBackground -> {"Columns" -> {{Automatic}}}, 
                GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {"Columns" -> {{0.2}}, "Rows" -> {{0.5}}}],
               True -> GridBox[{{
                  OpenerBox[
                   Dynamic[Typeset`var$$], Appearance -> Automatic, 
                   AutoAction -> False, ContinuousAction -> False, Enabled -> 
                   Automatic], "\"Profiles setup\""}, {"", 
                  PaneBox[
                   TagBox[
                    GridBox[{{"\"Profiles moving averange\""}, {
                    InputFieldBox[
                    Dynamic[$CellContext`profilesaverange]]}}, 
                    DefaultBaseStyle -> "Column", 
                    GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                    GridBoxItemSize -> {
                    "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], 
                    "Column"], ImageMargins -> 0]}}, AutoDelete -> False, 
                BaselinePosition -> {1, 1}, 
                GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                GridBoxBackground -> {"Columns" -> {{Automatic}}}, 
                GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {
                 "Columns" -> {{0.2}}, "Rows" -> {{0.5}}}]}, 
             Dynamic[Typeset`var$$], Alignment -> Automatic, BaselinePosition -> 
             Baseline, DefaultBaseStyle -> "OpenerView", ImageMargins -> 0, 
             ImageSize -> Automatic], Deployed -> False, StripOnInput -> 
            False], 
           OpenerView[{"Profiles setup", 
             Column[{"Profiles moving averange", 
               InputField[
                Dynamic[$CellContext`profilesaverange]]}]}, False]], 
          DynamicModuleValues :> {}], Setting[#, {0}]& ],TagBox[
         DynamicModuleBox[{Typeset`var$$ = False}, 
          InterpretationBox[
           StyleBox[
            PaneSelectorBox[{False -> GridBox[{{
                  OpenerBox[
                   Dynamic[Typeset`var$$], Appearance -> Automatic, 
                   AutoAction -> False, ContinuousAction -> False, Enabled -> 
                   Automatic], "\"Calibration function setup\""}}, AutoDelete -> 
                False, BaselinePosition -> {1, 1}, 
                GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                GridBoxBackground -> {"Columns" -> {{Automatic}}}, 
                GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {"Columns" -> {{0.2}}, "Rows" -> {{0.5}}}],
               True -> GridBox[{{
                  OpenerBox[
                   Dynamic[Typeset`var$$], Appearance -> Automatic, 
                   AutoAction -> False, ContinuousAction -> False, Enabled -> 
                   Automatic], "\"Calibration function setup\""}, {"", 
                  PaneBox[
                   TagBox[
                    GridBox[{{
                    TemplateBox[{"\"Toggle line intensities\"", 
                    CheckboxBox[
                    Dynamic[$CellContext`togglecli]]}, "RowDefault"]}, {
                    TemplateBox[{"\"Toggle area intensities\"", 
                    CheckboxBox[
                    Dynamic[$CellContext`togglecai]]}, "RowDefault"]}, {
                    TemplateBox[{"\"Toggle line calibration\"", 
                    CheckboxBox[
                    Dynamic[$CellContext`togglecfl]]}, "RowDefault"]}, {
                    TemplateBox[{"\"Toggle area calibration\"", 
                    CheckboxBox[
                    Dynamic[$CellContext`togglecfa]]}, "RowDefault"]}}, 
                    DefaultBaseStyle -> "Column", 
                    GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                    GridBoxItemSize -> {
                    "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], 
                    "Column"], ImageMargins -> 0]}}, AutoDelete -> False, 
                BaselinePosition -> {1, 1}, 
                GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                GridBoxBackground -> {"Columns" -> {{Automatic}}}, 
                GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {
                 "Columns" -> {{0.2}}, "Rows" -> {{0.5}}}]}, 
             Dynamic[Typeset`var$$], Alignment -> Automatic, BaselinePosition -> 
             Baseline, DefaultBaseStyle -> "OpenerView", ImageMargins -> 0, 
             ImageSize -> Automatic], Deployed -> False, StripOnInput -> 
            False], 
           OpenerView[{"Calibration function setup", 
             Column[{
               Row[{"Toggle line intensities", 
                 Checkbox[
                  Dynamic[$CellContext`togglecli]]}], 
               Row[{"Toggle area intensities", 
                 Checkbox[
                  Dynamic[$CellContext`togglecai]]}], 
               Row[{"Toggle line calibration", 
                 Checkbox[
                  Dynamic[$CellContext`togglecfl]]}], 
               Row[{"Toggle area calibration", 
                 Checkbox[
                  Dynamic[$CellContext`togglecfa]]}]}]}, False]], 
          DynamicModuleValues :> {}], Setting[#, {0}]& ]},
       "RowDefault"]},
     {
      TagBox[
       StyleBox[
        DynamicModuleBox[{$CellContext`imagesize$$ = 
         350, $CellContext`labelx$$ = RawBoxes[
          RowBox[{
            
            RowBox[{"Vzd\[AAcute]lenost", " ", "od", " ", "st\[RHacek]edu", 
              " ", "kontaktu"}], ",", " ", "mm"}]], $CellContext`labely$$ = 
         RawBoxes[
          RowBox[{
            RowBox[{"Tlou\[SHacek]\[THacek]ka", " ", "filmu"}], ",", " ", 
            "\[Micro]m"}]], $CellContext`legend$$ = {
         "U = 40 mm\[CenterDot]\!\(\*SuperscriptBox[\(s\), \(-1\)]\)", 
          "U = 100 mm\[CenterDot]\!\(\*SuperscriptBox[\(s\), \(-1\)]\)", 
          "U = 150 mm\[CenterDot]\!\(\*SuperscriptBox[\(s\), \(-1\)]\)", 
          "U = 200 mm\[CenterDot]\!\(\*SuperscriptBox[\(s\), \(-1\)]\)", 
          "U = 400 mm\[CenterDot]\!\(\*SuperscriptBox[\(s\), \(-1\)]\)"}, \
$CellContext`legendheight$$ = 50, $CellContext`legendwidth$$ = 
         100, $CellContext`plotrangexmax$$ = .8, $CellContext`plotrangexmin$$ \
= -0.8, $CellContext`plotrangeymax$$ = 3, $CellContext`plotrangeymin$$ = 
         0, $CellContext`theoryrangemax$$ = 
         800, $CellContext`theoryrangemin$$ = 1, $CellContext`togglehd$$ = 
         True, $CellContext`togglehdehd$$ = 
         False, $CellContext`togglelabel$$ = 
         True, $CellContext`togglelegend$$ = True, Typeset`show$$ = True, 
         Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", 
         Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = 
         "\"untitled\"", Typeset`specs$$ = {{{
            Hold[$CellContext`theoryrangemin$$], 1, "Theory range min"}, 0, 
           1500, 0.1}, {{
            Hold[$CellContext`theoryrangemax$$], 800, "Theory range min"}, 0, 
           1500, 0.1}, {{
            Hold[$CellContext`plotrangexmin$$], 0.1, "Plot range X min"}, 0, 
           1500, 10}, {{
            Hold[$CellContext`plotrangexmax$$], 1000, "Plot range X max"}, 0, 
           1500, 0.1}, {{
            Hold[$CellContext`plotrangeymin$$], 0.01, "Plot range Y min"}, 0, 
           1500, 10}, {{
            Hold[$CellContext`plotrangeymax$$], 100, "Plot range Y max"}, 0, 
           1500, 0.1}, {{
            Hold[$CellContext`imagesize$$], 350, "Image size"}, 0, 2000, 
           0.1}, {{
            Hold[$CellContext`togglelabel$$], False, "Label"}, {
           True, False}}, {{
            Hold[$CellContext`labelx$$], Null, "Label X"}, Null}, {{
            Hold[$CellContext`labely$$], Null, "Label Y"}, Null}, {{
            Hold[$CellContext`togglelegend$$], False, "Legend"}, {
           True, False}}, {{
            Hold[$CellContext`legendwidth$$], 100, "Legen width"}, 0, 300, 
           0.1}, {{
            Hold[$CellContext`legendheight$$], 30, "Legend height"}, 0, 300, 
           0.1}, {{
            Hold[$CellContext`legend$$], Null, "Legend"}, Null}, {{
            Hold[$CellContext`togglehd$$], True, "Hammrock&Dowson I-EHD"}, {
           True, False}}, {{
            Hold[$CellContext`togglehdehd$$], False, "Hammrock&Dowson EHD"}, {
           True, False}}}, Typeset`size$$ = {350., {128., 133.}}, 
         Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = 
         True, $CellContext`theoryrangemin$99325$$ = 
         0, $CellContext`theoryrangemax$99326$$ = 
         0, $CellContext`plotrangexmin$99327$$ = 
         0, $CellContext`plotrangexmax$99328$$ = 
         0, $CellContext`plotrangeymin$99329$$ = 
         0, $CellContext`plotrangeymax$99330$$ = 
         0, $CellContext`imagesize$99331$$ = 
         0, $CellContext`togglelabel$99332$$ = 
         False, $CellContext`togglelegend$99333$$ = 
         False, $CellContext`legendwidth$99334$$ = 
         0, $CellContext`legendheight$99335$$ = 
         0, $CellContext`togglehd$99336$$ = 
         False, $CellContext`togglehdehd$99337$$ = False}, 
         DynamicBox[Manipulate`ManipulateBoxes[
          1, StandardForm, 
           "Variables" :> {$CellContext`imagesize$$ = 
             350, $CellContext`labelx$$ = Null, $CellContext`labely$$ = 
             Null, $CellContext`legend$$ = Null, $CellContext`legendheight$$ = 
             30, $CellContext`legendwidth$$ = 
             100, $CellContext`plotrangexmax$$ = 
             1000, $CellContext`plotrangexmin$$ = 
             0.1, $CellContext`plotrangeymax$$ = 
             100, $CellContext`plotrangeymin$$ = 
             0.01, $CellContext`theoryrangemax$$ = 
             800, $CellContext`theoryrangemin$$ = 1, $CellContext`togglehd$$ = 
             True, $CellContext`togglehdehd$$ = 
             False, $CellContext`togglelabel$$ = 
             False, $CellContext`togglelegend$$ = False}, 
           "ControllerVariables" :> {
             
             Hold[$CellContext`theoryrangemin$$, \
$CellContext`theoryrangemin$99325$$, 0], 
             
             Hold[$CellContext`theoryrangemax$$, \
$CellContext`theoryrangemax$99326$$, 0], 
             
             Hold[$CellContext`plotrangexmin$$, \
$CellContext`plotrangexmin$99327$$, 0], 
             
             Hold[$CellContext`plotrangexmax$$, \
$CellContext`plotrangexmax$99328$$, 0], 
             
             Hold[$CellContext`plotrangeymin$$, \
$CellContext`plotrangeymin$99329$$, 0], 
             
             Hold[$CellContext`plotrangeymax$$, \
$CellContext`plotrangeymax$99330$$, 0], 
             
             Hold[$CellContext`imagesize$$, $CellContext`imagesize$99331$$, 
              0], 
             
             Hold[$CellContext`togglelabel$$, \
$CellContext`togglelabel$99332$$, False], 
             
             Hold[$CellContext`togglelegend$$, \
$CellContext`togglelegend$99333$$, False], 
             
             Hold[$CellContext`legendwidth$$, \
$CellContext`legendwidth$99334$$, 0], 
             
             Hold[$CellContext`legendheight$$, \
$CellContext`legendheight$99335$$, 0], 
             
             Hold[$CellContext`togglehd$$, $CellContext`togglehd$99336$$, 
              False], 
             
             Hold[$CellContext`togglehdehd$$, \
$CellContext`togglehdehd$99337$$, False]}, 
           "OtherVariables" :> {
            Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, 
             Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, 
             Typeset`specs$$, Typeset`size$$, Typeset`update$$, 
             Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> Show[
             If[$CellContext`showngraphs == 1, {$CellContext`cft = Quiet[
                 Show[
                  LogLogPlot[{
                    If[$CellContext`togglehd$$, 
                    $CellContext`Hc[$CellContext`u]], 
                    If[$CellContext`togglehdehd$$, 
                    $CellContext`Hcehd[$CellContext`u]]}, {$CellContext`u, \
$CellContext`theoryrangemin$$, $CellContext`theoryrangemax$$}, 
                   PlotRange -> {{$CellContext`plotrangexmin$$, \
$CellContext`plotrangexmax$$}, {$CellContext`plotrangeymin$$, \
$CellContext`plotrangeymax$$}}, 
                   LabelStyle -> {FontFamily -> "Verdana", FontSize -> 16}, 
                   PlotStyle -> {Red, 
                    RGBColor[0.88, 0.61, 0.14], 
                    RGBColor[0.56, 0.69, 0.196], Purple, Thick}, PlotLabel -> 
                   Style["", FontFamily -> "Verdana", FontSize -> 14], 
                   Frame -> {True, True, True, True}, FrameTicks -> {{
                    $CellContext`ticks[-2, 2, {0.01, 0.1, 1, 10, 100, 1000}], 
                    Automatic}, {
                    $CellContext`ticks[-2, 2, {0.01, 0.1, 1, 10, 100, 1000}], 
                    Automatic}}, 
                   GridLines -> {{1, 10, 100}, {0.01, 0.1, 1, 10}}, 
                   FrameLabel -> {
                    Style[
                    If[$CellContext`togglelabel$$, $CellContext`labelx$$], 
                    FontFamily -> "Verdana", FontSize -> 15], 
                    Style[
                    If[$CellContext`togglelabel$$, $CellContext`labely$$], 
                    FontFamily -> "Verdana", FontSize -> 15]}, 
                   ImageSize -> $CellContext`imagesize$$], 
                  ListLogLogPlot[
                   If[$CellContext`toggleavcft, 
                    Join[
                    Partition[
                    ToExpression[
                    ReplaceAll[
                    
                    Join[$CellContext`staticnames, \
$CellContext`contactnames], {
                    "Static" -> 0, "Static1" -> 0, "Static2" -> 0, "Static3" -> 
                    0}]], 1], 
                    Table[
                    $CellContext`averangecentral[
                    
                    Part[$CellContext`calibratedcontacts, $CellContext`i], \
$CellContext`cftavcircle, 
                    
                    Part[$CellContext`contactcenters, $CellContext`i]], \
{$CellContext`i, 
                    Part[
                    Dimensions[$CellContext`calibratedcontacts], 1]}], 2], 
                    Join[
                    Partition[
                    ToExpression[
                    ReplaceAll[
                    
                    Join[$CellContext`staticnames, \
$CellContext`contactnames], {
                    "Static1" -> 0, "Static2" -> 0, "Static3" -> 0}]], 1], 
                    Flatten[
                    Table[
                    Map[Take[
                    Part[$CellContext`calibratedcontacts, $CellContext`i], {
                    
                    Round[$CellContext`imagesizey/$CellContext`pixelbinning - 
                    Part[#, 2]], 
                    
                    Round[$CellContext`imagesizey/$CellContext`pixelbinning - 
                    Part[#, 2]]}, {
                    Round[
                    Part[#, 1]], 
                    Round[
                    Part[#, 1]]}]& , 
                    Part[
                    
                    Partition[$CellContext`contactcenters, 
                    1], $CellContext`i]], {$CellContext`i, 
                    Part[
                    Dimensions[$CellContext`calibratedcontacts], 1]}], 2], 
                    2]]]]], 
               Quiet[
                If[$CellContext`togglelegend$$, 
                 Graphics[
                  Inset[
                   Part[
                    $CellContext`plotlabel[$CellContext`cft, \
$CellContext`legendheight$$, $CellContext`legendwidth$$, \
$CellContext`legend$$], 1]], Epilog -> PointSize[Medium]], 
                 Graphics[]]]}, {}], 
             If[$CellContext`showngraphs == 2, {$CellContext`lcft = Quiet[
                 Show[
                  Plot[{
                    If[$CellContext`togglehd$$, 
                    $CellContext`Hc[$CellContext`u]], 
                    If[$CellContext`togglehdehd$$, 
                    $CellContext`Hcehd[$CellContext`u]]}, {$CellContext`u, \
$CellContext`theoryrangemin$$, $CellContext`theoryrangemax$$}, 
                   PlotRange -> {{$CellContext`plotrangexmin$$, \
$CellContext`plotrangexmax$$}, {$CellContext`plotrangeymin$$, \
$CellContext`plotrangeymax$$}}, 
                   LabelStyle -> {FontFamily -> "Verdana", FontSize -> 16}, 
                   PlotStyle -> {Red, 
                    RGBColor[0.88, 0.61, 0.14], 
                    RGBColor[0.56, 0.69, 0.196], Purple, Thick}, PlotLabel -> 
                   Style["", FontFamily -> "Verdana", FontSize -> 14], 
                   Frame -> {True, True, True, True}, GridLines -> {
                    If[$CellContext`plotrangexmax$$ < 500, {50, 100, 150, 200,
                     250, 300, 350, 400, 450}, 
                    
                    If[$CellContext`plotrangexmax$$ > 800, {200, 400, 600, 
                    800, 1000}, {100, 200, 300, 400, 500, 600, 700, 800}]], 
                    
                    If[$CellContext`plotrangeymax$$ < 1.7, {
                    0.2, 0.4, 0.8, 1, 1.2, 1.4, 1.6}, {
                    0.5, 1, 1.5, 2, 2.5, 3, 3.5}]}, FrameLabel -> {
                    Style[
                    If[$CellContext`togglelabel$$, $CellContext`labelx$$], 
                    FontFamily -> "Verdana", FontSize -> 15], 
                    Style[
                    If[$CellContext`togglelabel$$, $CellContext`labely$$], 
                    FontFamily -> "Verdana", FontSize -> 15]}, 
                   ImageSize -> $CellContext`imagesize$$], 
                  ListPlot[
                   If[$CellContext`toggleavcft, 
                    Join[
                    Partition[
                    ToExpression[
                    ReplaceAll[
                    
                    Join[$CellContext`staticnames, \
$CellContext`contactnames], {
                    "Static" -> 0, "Static1" -> 0, "Static2" -> 0, "Static3" -> 
                    0}]], 1], 
                    Table[
                    $CellContext`averangecentral[
                    
                    Part[$CellContext`calibratedcontacts, $CellContext`i], \
$CellContext`cftavcircle, 
                    
                    Part[$CellContext`contactcenters, $CellContext`i]], \
{$CellContext`i, 
                    Part[
                    Dimensions[$CellContext`calibratedcontacts], 1]}], 2], 
                    Join[
                    Partition[
                    ToExpression[
                    ReplaceAll[
                    
                    Join[$CellContext`staticnames, \
$CellContext`contactnames], {
                    "Static1" -> 0, "Static2" -> 0, "Static3" -> 0}]], 1], 
                    Flatten[
                    Table[
                    Map[Take[
                    Part[$CellContext`calibratedcontacts, $CellContext`i], {
                    Round[$CellContext`imagesizey/$CellContext`pixelbinning - 
                    Part[#, 2]], 
                    
                    Round[$CellContext`imagesizey/$CellContext`pixelbinning - 
                    Part[#, 2]]}, {
                    Round[
                    Part[#, 1]], 
                    Round[
                    Part[#, 1]]}]& , 
                    Part[
                    
                    Partition[$CellContext`contactcenters, 
                    1], $CellContext`i]], {$CellContext`i, 
                    Part[
                    Dimensions[$CellContext`calibratedcontacts], 1]}], 2], 
                    2]]]]], 
               Quiet[
                If[$CellContext`togglelegend$$, 
                 Graphics[
                  Inset[
                   Part[
                    $CellContext`plotlabel[$CellContext`lcft, \
$CellContext`legendheight$$, $CellContext`legendwidth$$, \
$CellContext`legend$$], 1]], Epilog -> PointSize[Medium]], 
                 Graphics[]]]}, {}], 
             If[$CellContext`showngraphs == 3, {$CellContext`cpro = Quiet[
                 Show[
                  
                  Plot[{}, {$CellContext`u, $CellContext`theoryrangemin$$, \
$CellContext`theoryrangemax$$}, 
                   PlotRange -> {{$CellContext`plotrangexmin$$, \
$CellContext`plotrangexmax$$}, {$CellContext`plotrangeymin$$, \
$CellContext`plotrangeymax$$}}, 
                   LabelStyle -> {FontFamily -> "Verdana", FontSize -> 16}, 
                   PlotLabel -> 
                   Style["", FontFamily -> "Verdana", FontSize -> 14], 
                   Frame -> {True, True, True, True}, 
                   GridLines -> {{-0.8, -0.6, -0.4, -0.2, 0.2, 0.4, 0.6, 0.8}, 
                    
                    If[$CellContext`plotrangeymax$$ < 1.7, {
                    0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6}, {
                    0.5, 1, 1.5, 2, 2.5, 3, 3.5}]}, FrameLabel -> {
                    Style[
                    If[$CellContext`togglelabel$$, $CellContext`labelx$$], 
                    FontFamily -> "Verdana", FontSize -> 15], 
                    Style[
                    If[$CellContext`togglelabel$$, $CellContext`labely$$], 
                    FontFamily -> "Verdana", FontSize -> 15]}, 
                   ImageSize -> $CellContext`imagesize$$], 
                  ListPlot[
                   Part[
                    Table[
                    Join[
                    Partition[Round[
                    MovingAverage[
                    Range[$CellContext`imagesizex/$CellContext`pixelbinning] - 
                    Part[
                    Round[
                    Part[$CellContext`contactcenters, $CellContext`i]], 
                    1], $CellContext`profilesaverange]] \
($CellContext`pixelsize $CellContext`pixelbinning 
                    10^(-3)/$CellContext`magnification), 1], 
                    Part[
                    Map[Partition[#, 1]& , 
                    Map[MovingAverage[#, $CellContext`profilesaverange]& , 
                    Flatten[
                    Table[
                    Map[Take[
                    Part[$CellContext`calibratedcontacts, $CellContext`i], {
                    
                    Round[$CellContext`imagesizey/$CellContext`pixelbinning - 
                    Part[#, 2]], 
                    
                    Round[$CellContext`imagesizey/$CellContext`pixelbinning - 
                    Part[#, 2]]}, {
                    1, $CellContext`imagesizex/$CellContext`pixelbinning}]& , 
                    
                    Part[
                    
                    Partition[$CellContext`contactcenters, 
                    1], $CellContext`i]], {$CellContext`i, 
                    Part[
                    Dimensions[$CellContext`calibratedcontacts], 1]}], 
                    2]]], $CellContext`i], 2], {$CellContext`i, 
                    Part[
                    Dimensions[$CellContext`calibratedcontacts], 
                    1]}], $CellContext`shownprofiles]]]], 
               Quiet[
                If[$CellContext`togglelegend$$, 
                 Graphics[
                  Inset[
                   Part[
                    $CellContext`plotlabel[$CellContext`cpro, \
$CellContext`legendheight$$, $CellContext`legendwidth$$, \
$CellContext`legend$$], 1]], Epilog -> PointSize[Medium]], 
                 Graphics[]]]}, {}], 
             If[$CellContext`showngraphs == 4, {$CellContext`calin = Quiet[
                 Show[
                  
                  Plot[{}, {$CellContext`u, $CellContext`theoryrangemin$$, \
$CellContext`theoryrangemax$$}, 
                   PlotRange -> {{$CellContext`plotrangexmin$$, \
$CellContext`plotrangexmax$$}, {$CellContext`plotrangeymin$$, \
$CellContext`plotrangeymax$$}}, 
                   LabelStyle -> {FontFamily -> "Verdana", FontSize -> 16}, 
                   PlotLabel -> 
                   Style["", FontFamily -> "Verdana", FontSize -> 14], 
                   Frame -> {True, True, True, True}, 
                   GridLines -> {{10000, 20000, 30000, 40000, 50000, 60000}, 
                    
                    If[$CellContext`plotrangeymax$$ < 1.7, {
                    0.2, 0.4, 0.8, 1, 1.2, 1.4, 1.6}, {
                    0.5, 1, 1.5, 2, 2.5, 3, 3.5}]}, FrameLabel -> {
                    Style[
                    If[$CellContext`togglelabel$$, $CellContext`labelx$$], 
                    FontFamily -> "Verdana", FontSize -> 15], 
                    Style[
                    If[$CellContext`togglelabel$$, $CellContext`labely$$], 
                    FontFamily -> "Verdana", FontSize -> 15]}], 
                  ListPlot[
                   
                   If[$CellContext`togglecai, \
$CellContext`areacalibrationdata, {}]], 
                  ListPlot[
                   
                   If[$CellContext`togglecli, \
$CellContext`linecalibrationdata, {}], PlotStyle -> 
                   RGBColor[0.88, 0.61, 0.14]], 
                  Plot[{
                    If[$CellContext`togglecfa, 
                    $CellContext`cfa[$CellContext`u]], 
                    If[$CellContext`togglecfl, 
                    $CellContext`cfl[$CellContext`u]]}, {$CellContext`u, \
$CellContext`theoryrangemin$$, $CellContext`theoryrangemax$$}, 
                   PlotStyle -> {{
                    Thickness[0.008], Red}, {
                    Thickness[0.0065], 
                    RGBColor[0.56, 0.69, 0.196]}}]]], 
               Quiet[
                If[$CellContext`togglelegend$$, 
                 Graphics[
                  Inset[
                   Part[
                    $CellContext`plotlabel[$CellContext`calin, \
$CellContext`legendheight$$, $CellContext`legendwidth$$, \
$CellContext`legend$$], 1]], Epilog -> PointSize[Medium]], 
                 Graphics[]]]}, {}]], 
           "Specifications" :> {{{$CellContext`theoryrangemin$$, 1, 
               "Theory range min"}, 0, 1500, 0.1, ControlType -> 
              InputField}, {{$CellContext`theoryrangemax$$, 800, 
               "Theory range min"}, 0, 1500, 0.1, ControlType -> 
              InputField}, {{$CellContext`plotrangexmin$$, 0.1, 
               "Plot range X min"}, 0, 1500, 10, ControlType -> 
              InputField}, {{$CellContext`plotrangexmax$$, 1000, 
               "Plot range X max"}, 0, 1500, 0.1, ControlType -> 
              InputField}, {{$CellContext`plotrangeymin$$, 0.01, 
               "Plot range Y min"}, 0, 1500, 10, ControlType -> 
              InputField}, {{$CellContext`plotrangeymax$$, 100, 
               "Plot range Y max"}, 0, 1500, 0.1, ControlType -> 
              InputField}, {{$CellContext`imagesize$$, 350, "Image size"}, 0, 
              2000, 0.1, ControlType -> 
              InputField}, {{$CellContext`togglelabel$$, False, "Label"}, {
              True, False}}, {{$CellContext`labelx$$, Null, "Label X"}, Null, 
              ControlType -> 
              InputField}, {{$CellContext`labely$$, Null, "Label Y"}, Null, 
              ControlType -> 
              InputField}, {{$CellContext`togglelegend$$, False, "Legend"}, {
              True, False}}, {{$CellContext`legendwidth$$, 100, 
               "Legen width"}, 0, 300, 0.1, ControlType -> 
              InputField}, {{$CellContext`legendheight$$, 30, 
               "Legend height"}, 0, 300, 0.1, ControlType -> 
              InputField}, {{$CellContext`legend$$, Null, "Legend"}, Null, 
              ControlType -> 
              InputField}, {{$CellContext`togglehd$$, True, 
               "Hammrock&Dowson I-EHD"}, {
              True, False}}, {{$CellContext`togglehdehd$$, False, 
               "Hammrock&Dowson EHD"}, {True, False}}}, "Options" :> {}, 
           "DefaultOptions" :> {}],
          ImageSizeCache->{698., {295., 300.}},
          SingleEvaluation->True],
         Deinitialization:>None,
         DynamicModuleValues:>{},
         SynchronousInitialization->True,
         UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$},
         UnsavedVariables:>{Typeset`initDone$$},
         UntrackedVariables:>{Typeset`size$$}], "Manipulate",
        Deployed->True,
        StripOnInput->False],
       Manipulate`InterpretManipulate[1]]}
    },
    DefaultBaseStyle->"Column",
    GridBoxAlignment->{"Columns" -> {{Left}}},
    GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}],
   "Column"],
  Background->RGBColor[0.85, 0.85, 0.85]]], "Input",
 CellChangeTimes->{3.641110090332013*^9}],

Cell[BoxData[
 PanelBox[
  TagBox[GridBox[{
     {
      TemplateBox[{InterpretationBox[
         StyleBox[
          GridBox[{{
             SetterBox[
              Dynamic[$CellContext`showngraphs], {1}, 
              "\"Film thicknesses logarithmic\""], 
             SetterBox[
              Dynamic[$CellContext`showngraphs], {2}, 
              "\"Film thicknesses linear\""], 
             SetterBox[
              Dynamic[$CellContext`showngraphs], {3}, "\"Contact profiles\""], 
             SetterBox[
              Dynamic[$CellContext`showngraphs], {4}, 
              "\"Calibration function\""]}}, ColumnSpacings -> 0, 
           BaselinePosition -> {1, 1}], Deployed -> True], 
         SetterBar[
          Dynamic[$CellContext`showngraphs], {
          1 -> "Film thicknesses logarithmic", 2 -> "Film thicknesses linear",
            3 -> "Contact profiles", 4 -> "Calibration function"}]]},
       "RowDefault"]},
     {
      TemplateBox[{TagBox[
         DynamicModuleBox[{Typeset`var$$ = False}, 
          InterpretationBox[
           StyleBox[
            PaneSelectorBox[{False -> GridBox[{{
                  OpenerBox[
                   Dynamic[Typeset`var$$], Appearance -> Automatic, 
                   AutoAction -> False, ContinuousAction -> False, Enabled -> 
                   Automatic], "\"Thicknesses setup\""}}, AutoDelete -> False,
                 BaselinePosition -> {1, 1}, 
                GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                GridBoxBackground -> {"Columns" -> {{Automatic}}}, 
                GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {"Columns" -> {{0.2}}, "Rows" -> {{0.5}}}],
               True -> GridBox[{{
                  OpenerBox[
                   Dynamic[Typeset`var$$], Appearance -> Automatic, 
                   AutoAction -> False, ContinuousAction -> False, Enabled -> 
                   Automatic], "\"Thicknesses setup\""}, {"", 
                  PaneBox[
                   TemplateBox[{"\"Take thicknesses from average area\"", 
                    CheckboxBox[
                    Dynamic[$CellContext`toggleavcft]]}, "RowDefault"], 
                   ImageMargins -> 0]}}, AutoDelete -> False, 
                BaselinePosition -> {1, 1}, 
                GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                GridBoxBackground -> {"Columns" -> {{Automatic}}}, 
                GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {
                 "Columns" -> {{0.2}}, "Rows" -> {{0.5}}}]}, 
             Dynamic[Typeset`var$$], Alignment -> Automatic, BaselinePosition -> 
             Baseline, DefaultBaseStyle -> "OpenerView", ImageMargins -> 0, 
             ImageSize -> Automatic], Deployed -> False, StripOnInput -> 
            False], 
           OpenerView[{"Thicknesses setup", 
             Row[{"Take thicknesses from average area", 
               Checkbox[
                Dynamic[$CellContext`toggleavcft]]}]}, False]], 
          DynamicModuleValues :> {}], Setting[#, {0}]& ],TagBox[
         DynamicModuleBox[{Typeset`var$$ = False}, 
          InterpretationBox[
           StyleBox[
            PaneSelectorBox[{False -> GridBox[{{
                  OpenerBox[
                   Dynamic[Typeset`var$$], Appearance -> Automatic, 
                   AutoAction -> False, ContinuousAction -> False, Enabled -> 
                   Automatic], "\"Show profiles\""}}, AutoDelete -> False, 
                BaselinePosition -> {1, 1}, 
                GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                GridBoxBackground -> {"Columns" -> {{Automatic}}}, 
                GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {"Columns" -> {{0.2}}, "Rows" -> {{0.5}}}],
               True -> GridBox[{{
                  OpenerBox[
                   Dynamic[Typeset`var$$], Appearance -> Automatic, 
                   AutoAction -> False, ContinuousAction -> False, Enabled -> 
                   Automatic], "\"Show profiles\""}, {"", 
                  PaneBox[
                   InterpretationBox[
                    StyleBox[
                    GridBox[{{
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 1], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    1]& ], {True}, "\"Static\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 2], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    2]& ], {True}, "\"100\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 3], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    3]& ], {True}, "\"10\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 4], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    4]& ], {True}, "\"150\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 5], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    5]& ], {True}, "\"200\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 6], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    6]& ], {True}, "\"20\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 7], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    7]& ], {True}, "\"300\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 8], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    8]& ], {True}, "\"400\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 9], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    9]& ], {True}, "\"40\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 10], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    10]& ], {True}, "\"500\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 11], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    11]& ], {True}, "\"5\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 12], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    12]& ], {True}, "\"60\""], 
                    SetterBox[
                    Dynamic[
                    MemberQ[$CellContext`shownprofiles, 13], 
                    BoxForm`TogglerBarFunction[$CellContext`shownprofiles, 
                    13]& ], {True}, "\"80\""]}}, BaselinePosition -> {1, 1}, 
                    GridBoxSpacings -> {"Columns" -> {
                    Offset[0.27999999999999997`], {
                    Offset[0.]}, 
                    Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, 
                    "Rows" -> {
                    Offset[0.2], {
                    Offset[0.4]}, 
                    Offset[0.2]}, "RowsIndexed" -> {}}], Deployed -> True], 
                    TogglerBar[
                    Dynamic[$CellContext`shownprofiles], {
                    1 -> "Static", 2 -> "100", 3 -> "10", 4 -> "150", 5 -> 
                    "200", 6 -> "20", 7 -> "300", 8 -> "400", 9 -> "40", 10 -> 
                    "500", 11 -> "5", 12 -> "60", 13 -> "80"}]], ImageMargins -> 
                   0]}}, AutoDelete -> False, BaselinePosition -> {1, 1}, 
                GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                GridBoxBackground -> {"Columns" -> {{Automatic}}}, 
                GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {
                 "Columns" -> {{0.2}}, "Rows" -> {{0.5}}}]}, 
             Dynamic[Typeset`var$$], Alignment -> Automatic, BaselinePosition -> 
             Baseline, DefaultBaseStyle -> "OpenerView", ImageMargins -> 0, 
             ImageSize -> Automatic], Deployed -> False, StripOnInput -> 
            False], 
           OpenerView[{"Show profiles", 
             TogglerBar[
              Dynamic[$CellContext`shownprofiles], {
              1 -> "Static", 2 -> "100", 3 -> "10", 4 -> "150", 5 -> "200", 6 -> 
               "20", 7 -> "300", 8 -> "400", 9 -> "40", 10 -> "500", 11 -> 
               "5", 12 -> "60", 13 -> "80"}]}, False]], 
          DynamicModuleValues :> {}], Setting[#, {0}]& ],TagBox[
         DynamicModuleBox[{Typeset`var$$ = False}, 
          InterpretationBox[
           StyleBox[
            PaneSelectorBox[{False -> GridBox[{{
                  OpenerBox[
                   Dynamic[Typeset`var$$], Appearance -> Automatic, 
                   AutoAction -> False, ContinuousAction -> False, Enabled -> 
                   Automatic], "\"Profiles setup\""}}, AutoDelete -> False, 
                BaselinePosition -> {1, 1}, 
                GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                GridBoxBackground -> {"Columns" -> {{Automatic}}}, 
                GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {"Columns" -> {{0.2}}, "Rows" -> {{0.5}}}],
               True -> GridBox[{{
                  OpenerBox[
                   Dynamic[Typeset`var$$], Appearance -> Automatic, 
                   AutoAction -> False, ContinuousAction -> False, Enabled -> 
                   Automatic], "\"Profiles setup\""}, {"", 
                  PaneBox[
                   TagBox[
                    GridBox[{{"\"Profiles moving averange\""}, {
                    InputFieldBox[
                    Dynamic[$CellContext`profilesaverange]]}}, 
                    DefaultBaseStyle -> "Column", 
                    GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                    GridBoxItemSize -> {
                    "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], 
                    "Column"], ImageMargins -> 0]}}, AutoDelete -> False, 
                BaselinePosition -> {1, 1}, 
                GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                GridBoxBackground -> {"Columns" -> {{Automatic}}}, 
                GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {
                 "Columns" -> {{0.2}}, "Rows" -> {{0.5}}}]}, 
             Dynamic[Typeset`var$$], Alignment -> Automatic, BaselinePosition -> 
             Baseline, DefaultBaseStyle -> "OpenerView", ImageMargins -> 0, 
             ImageSize -> Automatic], Deployed -> False, StripOnInput -> 
            False], 
           OpenerView[{"Profiles setup", 
             Column[{"Profiles moving averange", 
               InputField[
                Dynamic[$CellContext`profilesaverange]]}]}, False]], 
          DynamicModuleValues :> {}], Setting[#, {0}]& ],TagBox[
         DynamicModuleBox[{Typeset`var$$ = False}, 
          InterpretationBox[
           StyleBox[
            PaneSelectorBox[{False -> GridBox[{{
                  OpenerBox[
                   Dynamic[Typeset`var$$], Appearance -> Automatic, 
                   AutoAction -> False, ContinuousAction -> False, Enabled -> 
                   Automatic], "\"Calibration function setup\""}}, AutoDelete -> 
                False, BaselinePosition -> {1, 1}, 
                GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                GridBoxBackground -> {"Columns" -> {{Automatic}}}, 
                GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {"Columns" -> {{0.2}}, "Rows" -> {{0.5}}}],
               True -> GridBox[{{
                  OpenerBox[
                   Dynamic[Typeset`var$$], Appearance -> Automatic, 
                   AutoAction -> False, ContinuousAction -> False, Enabled -> 
                   Automatic], "\"Calibration function setup\""}, {"", 
                  PaneBox[
                   TagBox[
                    GridBox[{{
                    TemplateBox[{"\"Toggle line intensities\"", 
                    CheckboxBox[
                    Dynamic[$CellContext`togglecli]]}, "RowDefault"]}, {
                    TemplateBox[{"\"Toggle area intensities\"", 
                    CheckboxBox[
                    Dynamic[$CellContext`togglecai]]}, "RowDefault"]}, {
                    TemplateBox[{"\"Toggle line calibration\"", 
                    CheckboxBox[
                    Dynamic[$CellContext`togglecfl]]}, "RowDefault"]}, {
                    TemplateBox[{"\"Toggle area calibration\"", 
                    CheckboxBox[
                    Dynamic[$CellContext`togglecfa]]}, "RowDefault"]}}, 
                    DefaultBaseStyle -> "Column", 
                    GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                    GridBoxItemSize -> {
                    "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], 
                    "Column"], ImageMargins -> 0]}}, AutoDelete -> False, 
                BaselinePosition -> {1, 1}, 
                GridBoxAlignment -> {"Columns" -> {{Left}}}, 
                GridBoxBackground -> {"Columns" -> {{Automatic}}}, 
                GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {
                 "Columns" -> {{0.2}}, "Rows" -> {{0.5}}}]}, 
             Dynamic[Typeset`var$$], Alignment -> Automatic, BaselinePosition -> 
             Baseline, DefaultBaseStyle -> "OpenerView", ImageMargins -> 0, 
             ImageSize -> Automatic], Deployed -> False, StripOnInput -> 
            False], 
           OpenerView[{"Calibration function setup", 
             Column[{
               Row[{"Toggle line intensities", 
                 Checkbox[
                  Dynamic[$CellContext`togglecli]]}], 
               Row[{"Toggle area intensities", 
                 Checkbox[
                  Dynamic[$CellContext`togglecai]]}], 
               Row[{"Toggle line calibration", 
                 Checkbox[
                  Dynamic[$CellContext`togglecfl]]}], 
               Row[{"Toggle area calibration", 
                 Checkbox[
                  Dynamic[$CellContext`togglecfa]]}]}]}, False]], 
          DynamicModuleValues :> {}], Setting[#, {0}]& ]},
       "RowDefault"]},
     {
      TagBox[
       StyleBox[
        DynamicModuleBox[{$CellContext`imagesize$$ = 
         350, $CellContext`labelx$$ = RawBoxes[
          RowBox[{
            RowBox[{"St\[RHacek]edn\[IAcute]", " ", "rychlost"}], ",", " ", 
            RowBox[{"mm", "\[CenterDot]", 
              SuperscriptBox["s", 
               RowBox[{"-", "1"}]]}]}]], $CellContext`labely$$ = RawBoxes[
          RowBox[{
            RowBox[{"Tlou\[SHacek]\[THacek]ka", " ", "filmu"}], ",", " ", 
            "\[Micro]m"}]], $CellContext`legend$$ = {
         "Zat\[IAcute]\[ZHacek]en\[IAcute] 18,5 N", 
          "H&D I-EHL"}, $CellContext`legendheight$$ = 
         30, $CellContext`legendwidth$$ = 
         100, $CellContext`plotrangexmax$$ = .6, $CellContext`plotrangexmin$$ \
= -.6, $CellContext`plotrangeymax$$ = 2, $CellContext`plotrangeymin$$ = 
         0, $CellContext`theoryrangemax$$ = 
         800, $CellContext`theoryrangemin$$ = 2, $CellContext`togglehd$$ = 
         True, $CellContext`togglehdehd$$ = 
         False, $CellContext`togglelabel$$ = 
         True, $CellContext`togglelegend$$ = True, Typeset`show$$ = True, 
         Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", 
         Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = 
         "\"untitled\"", Typeset`specs$$ = {{{
            Hold[$CellContext`theoryrangemin$$], 1, "Theory range min"}, 0, 
           1500, 0.1}, {{
            Hold[$CellContext`theoryrangemax$$], 800, "Theory range min"}, 0, 
           1500, 0.1}, {{
            Hold[$CellContext`plotrangexmin$$], 0.1, "Plot range X min"}, 0, 
           1500, 10}, {{
            Hold[$CellContext`plotrangexmax$$], 1000, "Plot range X max"}, 0, 
           1500, 0.1}, {{
            Hold[$CellContext`plotrangeymin$$], 0.01, "Plot range Y min"}, 0, 
           1500, 10}, {{
            Hold[$CellContext`plotrangeymax$$], 100, "Plot range Y max"}, 0, 
           1500, 0.1}, {{
            Hold[$CellContext`imagesize$$], 350, "Image size"}, 0, 2000, 
           0.1}, {{
            Hold[$CellContext`togglelabel$$], False, "Label"}, {
           True, False}}, {{
            Hold[$CellContext`labelx$$], Null, "Label X"}, Null}, {{
            Hold[$CellContext`labely$$], Null, "Label Y"}, Null}, {{
            Hold[$CellContext`togglelegend$$], False, "Legend"}, {
           True, False}}, {{
            Hold[$CellContext`legendwidth$$], 100, "Legen width"}, 0, 300, 
           0.1}, {{
            Hold[$CellContext`legendheight$$], 30, "Legend height"}, 0, 300, 
           0.1}, {{
            Hold[$CellContext`legend$$], Null, "Legend"}, Null}, {{
            Hold[$CellContext`togglehd$$], True, "Hammrock&Dowson I-EHD"}, {
           True, False}}, {{
            Hold[$CellContext`togglehdehd$$], False, "Hammrock&Dowson EHD"}, {
           True, False}}}, Typeset`size$$ = {350., {125., 129.}}, 
         Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = 
         True, $CellContext`theoryrangemin$84005$$ = 
         0, $CellContext`theoryrangemax$84006$$ = 
         0, $CellContext`plotrangexmin$84007$$ = 
         0, $CellContext`plotrangexmax$84008$$ = 
         0, $CellContext`plotrangeymin$84009$$ = 
         0, $CellContext`plotrangeymax$84010$$ = 
         0, $CellContext`imagesize$84011$$ = 
         0, $CellContext`togglelabel$84012$$ = 
         False, $CellContext`togglelegend$84013$$ = 
         False, $CellContext`legendwidth$84014$$ = 
         0, $CellContext`legendheight$84015$$ = 
         0, $CellContext`togglehd$84016$$ = 
         False, $CellContext`togglehdehd$84017$$ = False}, 
         DynamicBox[Manipulate`ManipulateBoxes[
          1, StandardForm, 
           "Variables" :> {$CellContext`imagesize$$ = 
             350, $CellContext`labelx$$ = Null, $CellContext`labely$$ = 
             Null, $CellContext`legend$$ = Null, $CellContext`legendheight$$ = 
             30, $CellContext`legendwidth$$ = 
             100, $CellContext`plotrangexmax$$ = 
             1000, $CellContext`plotrangexmin$$ = 
             0.1, $CellContext`plotrangeymax$$ = 
             100, $CellContext`plotrangeymin$$ = 
             0.01, $CellContext`theoryrangemax$$ = 
             800, $CellContext`theoryrangemin$$ = 1, $CellContext`togglehd$$ = 
             True, $CellContext`togglehdehd$$ = 
             False, $CellContext`togglelabel$$ = 
             False, $CellContext`togglelegend$$ = False}, 
           "ControllerVariables" :> {
             
             Hold[$CellContext`theoryrangemin$$, \
$CellContext`theoryrangemin$84005$$, 0], 
             
             Hold[$CellContext`theoryrangemax$$, \
$CellContext`theoryrangemax$84006$$, 0], 
             
             Hold[$CellContext`plotrangexmin$$, \
$CellContext`plotrangexmin$84007$$, 0], 
             
             Hold[$CellContext`plotrangexmax$$, \
$CellContext`plotrangexmax$84008$$, 0], 
             
             Hold[$CellContext`plotrangeymin$$, \
$CellContext`plotrangeymin$84009$$, 0], 
             
             Hold[$CellContext`plotrangeymax$$, \
$CellContext`plotrangeymax$84010$$, 0], 
             
             Hold[$CellContext`imagesize$$, $CellContext`imagesize$84011$$, 
              0], 
             
             Hold[$CellContext`togglelabel$$, \
$CellContext`togglelabel$84012$$, False], 
             
             Hold[$CellContext`togglelegend$$, \
$CellContext`togglelegend$84013$$, False], 
             
             Hold[$CellContext`legendwidth$$, \
$CellContext`legendwidth$84014$$, 0], 
             
             Hold[$CellContext`legendheight$$, \
$CellContext`legendheight$84015$$, 0], 
             
             Hold[$CellContext`togglehd$$, $CellContext`togglehd$84016$$, 
              False], 
             
             Hold[$CellContext`togglehdehd$$, \
$CellContext`togglehdehd$84017$$, False]}, 
           "OtherVariables" :> {
            Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, 
             Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, 
             Typeset`specs$$, Typeset`size$$, Typeset`update$$, 
             Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> Show[
             If[$CellContext`showngraphs == 1, {$CellContext`cft = Quiet[
                 Show[
                  LogLogPlot[{
                    If[$CellContext`togglehd$$, 
                    $CellContext`Hc[$CellContext`u]], 
                    If[$CellContext`togglehdehd$$, 
                    $CellContext`Hcehd[$CellContext`u]]}, {$CellContext`u, \
$CellContext`theoryrangemin$$, $CellContext`theoryrangemax$$}, 
                   PlotRange -> {{$CellContext`plotrangexmin$$, \
$CellContext`plotrangexmax$$}, {$CellContext`plotrangeymin$$, \
$CellContext`plotrangeymax$$}}, 
                   LabelStyle -> {FontFamily -> "Verdana", FontSize -> 16}, 
                   PlotStyle -> {Red, 
                    RGBColor[0.88, 0.61, 0.14], 
                    RGBColor[0.56, 0.69, 0.196], Purple, Thick}, PlotLabel -> 
                   Style["", FontFamily -> "Verdana", FontSize -> 14], 
                   Frame -> {True, True, True, True}, FrameTicks -> {{
                    $CellContext`ticks[-2, 2, {0.01, 0.1, 1, 10, 100, 1000}], 
                    Automatic}, {
                    $CellContext`ticks[-2, 2, {0.01, 0.1, 1, 10, 100, 1000}], 
                    Automatic}}, 
                   GridLines -> {{1, 10, 100}, {0.01, 0.1, 1, 10}}, 
                   FrameLabel -> {
                    Style[
                    If[$CellContext`togglelabel$$, $CellContext`labelx$$], 
                    FontFamily -> "Verdana", FontSize -> 15], 
                    Style[
                    If[$CellContext`togglelabel$$, $CellContext`labely$$], 
                    FontFamily -> "Verdana", FontSize -> 15]}, 
                   ImageSize -> $CellContext`imagesize$$], 
                  ListLogLogPlot[
                   If[$CellContext`toggleavcft, 
                    Join[
                    Partition[
                    ToExpression[
                    ReplaceAll[
                    
                    Join[$CellContext`staticnames, \
$CellContext`contactnames], {
                    "Static" -> 0, "Static1" -> 0, "Static2" -> 0, "Static3" -> 
                    0}]], 1], 
                    Table[
                    $CellContext`averangecentral[
                    
                    Part[$CellContext`calibratedcontacts, $CellContext`i], \
$CellContext`cftavcircle, 
                    
                    Part[$CellContext`contactcenters, $CellContext`i]], \
{$CellContext`i, 
                    Part[
                    Dimensions[$CellContext`calibratedcontacts], 1]}], 2], 
                    Join[
                    Partition[
                    ToExpression[
                    ReplaceAll[
                    
                    Join[$CellContext`staticnames, \
$CellContext`contactnames], {
                    "Static1" -> 0, "Static2" -> 0, "Static3" -> 0}]], 1], 
                    Flatten[
                    Table[
                    Map[Take[
                    Part[$CellContext`calibratedcontacts, $CellContext`i], {
                    
                    Round[$CellContext`imagesizey/$CellContext`pixelbinning - 
                    Part[#, 2]], 
                    
                    Round[$CellContext`imagesizey/$CellContext`pixelbinning - 
                    Part[#, 2]]}, {
                    Round[
                    Part[#, 1]], 
                    Round[
                    Part[#, 1]]}]& , 
                    Part[
                    
                    Partition[$CellContext`contactcenters, 
                    1], $CellContext`i]], {$CellContext`i, 
                    Part[
                    Dimensions[$CellContext`calibratedcontacts], 1]}], 2], 
                    2]]]]], 
               Quiet[
                If[$CellContext`togglelegend$$, 
                 Graphics[
                  Inset[
                   Part[
                    $CellContext`plotlabel[$CellContext`cft, \
$CellContext`legendheight$$, $CellContext`legendwidth$$, \
$CellContext`legend$$], 1]], Epilog -> PointSize[Medium]], 
                 Graphics[]]]}, {}], 
             If[$CellContext`showngraphs == 2, {$CellContext`lcft = Quiet[
                 Show[
                  Plot[{
                    If[$CellContext`togglehd$$, 
                    $CellContext`Hc[$CellContext`u]], 
                    If[$CellContext`togglehdehd$$, 
                    $CellContext`Hcehd[$CellContext`u]]}, {$CellContext`u, \
$CellContext`theoryrangemin$$, $CellContext`theoryrangemax$$}, 
                   PlotRange -> {{$CellContext`plotrangexmin$$, \
$CellContext`plotrangexmax$$}, {$CellContext`plotrangeymin$$, \
$CellContext`plotrangeymax$$}}, 
                   LabelStyle -> {FontFamily -> "Verdana", FontSize -> 16}, 
                   PlotStyle -> {Red, 
                    RGBColor[0.88, 0.61, 0.14], 
                    RGBColor[0.56, 0.69, 0.196], Purple, Thick}, PlotLabel -> 
                   Style["", FontFamily -> "Verdana", FontSize -> 14], 
                   Frame -> {True, True, True, True}, GridLines -> {
                    
                    If[$CellContext`plotrangexmax$$ < 500, {50, 100, 150, 200,
                     250, 300, 350, 400, 450}, 
                    
                    If[$CellContext`plotrangexmax$$ > 800, {200, 400, 600, 
                    800, 1000}, {100, 200, 300, 400, 500, 600, 700, 800}]], 
                    
                    If[$CellContext`plotrangeymax$$ < 1.7, {
                    0.2, 0.4, 0.8, 1, 1.2, 1.4, 1.6}, {
                    0.5, 1, 1.5, 2, 2.5, 3, 3.5}]}, FrameLabel -> {
                    Style[
                    If[$CellContext`togglelabel$$, $CellContext`labelx$$], 
                    FontFamily -> "Verdana", FontSize -> 15], 
                    Style[
                    If[$CellContext`togglelabel$$, $CellContext`labely$$], 
                    FontFamily -> "Verdana", FontSize -> 15]}, 
                   ImageSize -> $CellContext`imagesize$$], 
                  ListPlot[
                   If[$CellContext`toggleavcft, 
                    Join[
                    Partition[
                    ToExpression[
                    ReplaceAll[
                    
                    Join[$CellContext`staticnames, \
$CellContext`contactnames], {
                    "Static" -> 0, "Static1" -> 0, "Static2" -> 0, "Static3" -> 
                    0}]], 1], 
                    Table[
                    $CellContext`averangecentral[
                    
                    Part[$CellContext`calibratedcontacts, $CellContext`i], \
$CellContext`cftavcircle, 
                    
                    Part[$CellContext`contactcenters, $CellContext`i]], \
{$CellContext`i, 
                    Part[
                    Dimensions[$CellContext`calibratedcontacts], 1]}], 2], 
                    Join[
                    Partition[
                    ToExpression[
                    ReplaceAll[
                    
                    Join[$CellContext`staticnames, \
$CellContext`contactnames], {
                    "Static1" -> 0, "Static2" -> 0, "Static3" -> 0}]], 1], 
                    Flatten[
                    Table[
                    Map[Take[
                    Part[$CellContext`calibratedcontacts, $CellContext`i], {
                    
                    Round[$CellContext`imagesizey/$CellContext`pixelbinning - 
                    Part[#, 2]], 
                    
                    Round[$CellContext`imagesizey/$CellContext`pixelbinning - 
                    Part[#, 2]]}, {
                    Round[
                    Part[#, 1]], 
                    Round[
                    Part[#, 1]]}]& , 
                    Part[
                    
                    Partition[$CellContext`contactcenters, 
                    1], $CellContext`i]], {$CellContext`i, 
                    Part[
                    Dimensions[$CellContext`calibratedcontacts], 1]}], 2], 
                    2]]]]], 
               Quiet[
                If[$CellContext`togglelegend$$, 
                 Graphics[
                  Inset[
                   Part[
                    $CellContext`plotlabel[$CellContext`lcft, \
$CellContext`legendheight$$, $CellContext`legendwidth$$, \
$CellContext`legend$$], 1]], Epilog -> PointSize[Medium]], 
                 Graphics[]]]}, {}], 
             If[$CellContext`showngraphs == 3, {$CellContext`cpro = Quiet[
                 Show[
                  
                  Plot[{}, {$CellContext`u, $CellContext`theoryrangemin$$, \
$CellContext`theoryrangemax$$}, 
                   PlotRange -> {{$CellContext`plotrangexmin$$, \
$CellContext`plotrangexmax$$}, {$CellContext`plotrangeymin$$, \
$CellContext`plotrangeymax$$}}, 
                   LabelStyle -> {FontFamily -> "Verdana", FontSize -> 16}, 
                   PlotLabel -> 
                   Style["", FontFamily -> "Verdana", FontSize -> 14], 
                   Frame -> {True, True, True, True}, 
                   GridLines -> {{-0.8, -0.6, -0.4, -0.2, 0.2, 0.4, 0.6, 0.8}, 
                    
                    If[$CellContext`plotrangeymax$$ < 1.7, {
                    0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6}, {
                    0.5, 1, 1.5, 2, 2.5, 3, 3.5}]}, FrameLabel -> {
                    Style[
                    If[$CellContext`togglelabel$$, $CellContext`labelx$$], 
                    FontFamily -> "Verdana", FontSize -> 15], 
                    Style[
                    If[$CellContext`togglelabel$$, $CellContext`labely$$], 
                    FontFamily -> "Verdana", FontSize -> 15]}, 
                   ImageSize -> $CellContext`imagesize$$], 
                  ListPlot[
                   Part[
                    Table[
                    Join[
                    Partition[Round[
                    MovingAverage[
                    Range[$CellContext`imagesizex/$CellContext`pixelbinning] - 
                    Part[
                    Round[
                    Part[$CellContext`contactcenters, $CellContext`i]], 
                    1], $CellContext`profilesaverange]] \
($CellContext`pixelsize 10^(-3)/$CellContext`magnification), 1], 
                    Part[
                    Map[Partition[#, 1]& , 
                    Map[MovingAverage[#, $CellContext`profilesaverange]& , 
                    Flatten[
                    Table[
                    Map[Take[
                    Part[$CellContext`calibratedcontacts, $CellContext`i], {
                    
                    Round[$CellContext`imagesizey/$CellContext`pixelbinning - 
                    Part[#, 2]], 
                    
                    Round[$CellContext`imagesizey/$CellContext`pixelbinning - 
                    Part[#, 2]]}, {
                    1, $CellContext`imagesizex/$CellContext`pixelbinning}]& , 
                    
                    Part[
                    
                    Partition[$CellContext`contactcenters, 
                    1], $CellContext`i]], {$CellContext`i, 
                    Part[
                    Dimensions[$CellContext`calibratedcontacts], 1]}], 
                    2]]], $CellContext`i], 2], {$CellContext`i, 
                    Part[
                    Dimensions[$CellContext`calibratedcontacts], 
                    1]}], $CellContext`shownprofiles]]]], 
               Quiet[
                If[$CellContext`togglelegend$$, 
                 Graphics[
                  Inset[
                   Part[
                    $CellContext`plotlabel[$CellContext`cpro, \
$CellContext`legendheight$$, $CellContext`legendwidth$$, \
$CellContext`legend$$], 1]], Epilog -> PointSize[Medium]], 
                 Graphics[]]]}, {}], 
             If[$CellContext`showngraphs == 4, {$CellContext`calin = Quiet[
                 Show[
                  
                  Plot[{}, {$CellContext`u, $CellContext`theoryrangemin$$, \
$CellContext`theoryrangemax$$}, 
                   PlotRange -> {{$CellContext`plotrangexmin$$, \
$CellContext`plotrangexmax$$}, {$CellContext`plotrangeymin$$, \
$CellContext`plotrangeymax$$}}, 
                   LabelStyle -> {FontFamily -> "Verdana", FontSize -> 16}, 
                   PlotLabel -> 
                   Style["", FontFamily -> "Verdana", FontSize -> 14], 
                   Frame -> {True, True, True, True}, 
                   GridLines -> {{10000, 20000, 30000, 40000, 50000, 60000}, 
                    
                    If[$CellContext`plotrangeymax$$ < 1.7, {
                    0.2, 0.4, 0.8, 1, 1.2, 1.4, 1.6}, {
                    0.5, 1, 1.5, 2, 2.5, 3, 3.5}]}, FrameLabel -> {
                    Style[
                    If[$CellContext`togglelabel$$, $CellContext`labelx$$], 
                    FontFamily -> "Verdana", FontSize -> 15], 
                    Style[
                    If[$CellContext`togglelabel$$, $CellContext`labely$$], 
                    FontFamily -> "Verdana", FontSize -> 15]}], 
                  ListPlot[
                   
                   If[$CellContext`togglecai, \
$CellContext`areacalibrationdata, {}]], 
                  ListPlot[
                   
                   If[$CellContext`togglecli, \
$CellContext`linecalibrationdata, {}], PlotStyle -> 
                   RGBColor[0.88, 0.61, 0.14]], 
                  Plot[{
                    If[$CellContext`togglecfa, 
                    $CellContext`cfa[$CellContext`u]], 
                    If[$CellContext`togglecfl, 
                    $CellContext`cfl[$CellContext`u]]}, {$CellContext`u, \
$CellContext`theoryrangemin$$, $CellContext`theoryrangemax$$}, 
                   PlotStyle -> {{
                    Thickness[0.008], Red}, {
                    Thickness[0.0065], 
                    RGBColor[0.56, 0.69, 0.196]}}]]], 
               Quiet[
                If[$CellContext`togglelegend$$, 
                 Graphics[
                  Inset[
                   Part[
                    $CellContext`plotlabel[$CellContext`calin, \
$CellContext`legendheight$$, $CellContext`legendwidth$$, \
$CellContext`legend$$], 1]], Epilog -> PointSize[Medium]], 
                 Graphics[]]]}, {}]], 
           "Specifications" :> {{{$CellContext`theoryrangemin$$, 1, 
               "Theory range min"}, 0, 1500, 0.1, ControlType -> 
              InputField}, {{$CellContext`theoryrangemax$$, 800, 
               "Theory range min"}, 0, 1500, 0.1, ControlType -> 
              InputField}, {{$CellContext`plotrangexmin$$, 0.1, 
               "Plot range X min"}, 0, 1500, 10, ControlType -> 
              InputField}, {{$CellContext`plotrangexmax$$, 1000, 
               "Plot range X max"}, 0, 1500, 0.1, ControlType -> 
              InputField}, {{$CellContext`plotrangeymin$$, 0.01, 
               "Plot range Y min"}, 0, 1500, 10, ControlType -> 
              InputField}, {{$CellContext`plotrangeymax$$, 100, 
               "Plot range Y max"}, 0, 1500, 0.1, ControlType -> 
              InputField}, {{$CellContext`imagesize$$, 350, "Image size"}, 0, 
              2000, 0.1, ControlType -> 
              InputField}, {{$CellContext`togglelabel$$, False, "Label"}, {
              True, False}}, {{$CellContext`labelx$$, Null, "Label X"}, Null, 
              ControlType -> 
              InputField}, {{$CellContext`labely$$, Null, "Label Y"}, Null, 
              ControlType -> 
              InputField}, {{$CellContext`togglelegend$$, False, "Legend"}, {
              True, False}}, {{$CellContext`legendwidth$$, 100, 
               "Legen width"}, 0, 300, 0.1, ControlType -> 
              InputField}, {{$CellContext`legendheight$$, 30, 
               "Legend height"}, 0, 300, 0.1, ControlType -> 
              InputField}, {{$CellContext`legend$$, Null, "Legend"}, Null, 
              ControlType -> 
              InputField}, {{$CellContext`togglehd$$, True, 
               "Hammrock&Dowson I-EHD"}, {
              True, False}}, {{$CellContext`togglehdehd$$, False, 
               "Hammrock&Dowson EHD"}, {True, False}}}, "Options" :> {}, 
           "DefaultOptions" :> {}],
          ImageSizeCache->{698., {198., 203.}},
          SingleEvaluation->True],
         Deinitialization:>None,
         DynamicModuleValues:>{},
         SynchronousInitialization->True,
         UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$},
         UnsavedVariables:>{Typeset`initDone$$},
         UntrackedVariables:>{Typeset`size$$}], "Manipulate",
        Deployed->True,
        StripOnInput->False],
       Manipulate`InterpretManipulate[1]]}
    },
    DefaultBaseStyle->"Column",
    GridBoxAlignment->{"Columns" -> {{Left}}},
    GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}],
   "Column"],
  Background->RGBColor[0.85, 0.85, 0.85]]], "Input",
 CellChangeTimes->{3.641109863467451*^9}]
},
InitializationCellEvaluation->True,
InitializationCellWarning->False,
WindowSize->{1439, 797},
WindowMargins->{{Automatic, 0}, {Automatic, 0}},
FrontEndVersion->"10.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (September 9, \
2014)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[558, 20, 45550, 1057, 2758, "Input",
 InitializationCell->True],
Cell[CellGroupData[{
Cell[46133, 1081, 21628, 405, 709, "Input",
 InitializationCell->True],
Cell[67764, 1488, 6408, 153, 489, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[74209, 1646, 8947, 224, 648, "Input"],
Cell[83159, 1872, 2675, 54, 28, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[85871, 1931, 326, 9, 35, "Input"],
Cell[86200, 1942, 135, 2, 28, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[86372, 1949, 42708, 851, 1858, "Input"],
Cell[129083, 2802, 23909, 527, 862, "Output"],
Cell[152995, 3331, 497, 10, 24, "Message"],
Cell[153495, 3343, 497, 10, 24, "Message"],
Cell[153995, 3355, 497, 10, 24, "Message"],
Cell[154495, 3367, 540, 11, 24, "Message"]
}, Open  ]],
Cell[155050, 3381, 55560, 1117, 3003, "Input"],
Cell[210613, 4500, 38460, 778, 676, InheritFromParent],
Cell[249076, 5280, 38215, 776, 482, InheritFromParent]
}
]
*)

(* End of internal cache information *)
