daiquiri-ui 2025.12.5__py3-none-any.whl → 2026.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. daiquiri_ui/__init__.py +0 -1
  2. daiquiri_ui/static/assets/Anchor-0b4a3d33.js +1 -0
  3. daiquiri_ui/static/assets/AutoscaleOption-3cb99678.js +1 -0
  4. daiquiri_ui/static/assets/{BPMVideoStream-5e8c0121.js → BPMVideoStream-c3e09e8b.js} +1 -1
  5. daiquiri_ui/static/assets/{CanvasEnhancer-abaa5025.js → CanvasEnhancer-dd82c090.js} +1 -1
  6. daiquiri_ui/static/assets/ColorMap-be59ad21.js +1 -0
  7. daiquiri_ui/static/assets/CompositeMap-c93f5466.js +1 -0
  8. daiquiri_ui/static/assets/{ConnectUtils-bd734a4a.js → ConnectUtils-3923fa2f.js} +1 -1
  9. daiquiri_ui/static/assets/{Console-4f2397f7.js → Console-d0028912.js} +1 -1
  10. daiquiri_ui/static/assets/{Cross-80ee2b29.js → Cross-d5df0df3.js} +1 -1
  11. daiquiri_ui/static/assets/{CrossMarker-cc495eca.js → CrossMarker-71cd11cf.js} +2 -2
  12. daiquiri_ui/static/assets/DraggableRect-25d91c7d.js +1 -0
  13. daiquiri_ui/static/assets/DropdownButton-29cc265b.js +1 -0
  14. daiquiri_ui/static/assets/DropdownDetector-5016908a.js +1 -0
  15. daiquiri_ui/static/assets/{Editor-b897e35a.js → Editor-7b500b85.js} +9 -9
  16. daiquiri_ui/static/assets/EditorTree-7fc000d8.js +1 -0
  17. daiquiri_ui/static/assets/H5Viewer-d1305c58.js +1 -0
  18. daiquiri_ui/static/assets/{H5WebCurvePlot-acd3b964.js → H5WebCurvePlot-61b08211.js} +1 -1
  19. daiquiri_ui/static/assets/HSegment-8d2c001e.js +43 -0
  20. daiquiri_ui/static/assets/HardwareButton-af41c610.js +1 -0
  21. daiquiri_ui/static/assets/Hdf5Plot-bbffc65f.js +1 -0
  22. daiquiri_ui/static/assets/{HistogramDomainSlider-9c6d3e2d.js → HistogramDomainSlider-304bdab4.js} +1 -1
  23. daiquiri_ui/static/assets/Image-ee61818a.js +1 -0
  24. daiquiri_ui/static/assets/Label-9d8979b3.js +1 -0
  25. daiquiri_ui/static/assets/{LoadingMessage-072bb4e8.js → LoadingMessage-03b4fa4f.js} +1 -1
  26. daiquiri_ui/static/assets/NewScanButton-0051d220.js +1 -0
  27. daiquiri_ui/static/assets/NewScanButton-57cf0c17.js +1 -0
  28. daiquiri_ui/static/assets/OptionsProcess-da629bfb.js +1 -0
  29. daiquiri_ui/static/assets/ParametersList-2d01832f.js +1 -0
  30. daiquiri_ui/static/assets/RectRoi-3693cc65.js +1 -0
  31. daiquiri_ui/static/assets/RectRuler-1fee3fd8.js +543 -0
  32. daiquiri_ui/static/assets/RulerButton-a95a6035.js +139 -0
  33. daiquiri_ui/static/assets/SampleDCList-dce0bd2b.js +1 -0
  34. daiquiri_ui/static/assets/SampleRegistration-544aa4bd.js +1 -0
  35. daiquiri_ui/static/assets/SavingButton-c3efc92c.js +1 -0
  36. daiquiri_ui/static/assets/ScanDataService-16f29ecd.js +1 -0
  37. daiquiri_ui/static/assets/ScanPlot0d-67c76bfe.js +1 -0
  38. daiquiri_ui/static/assets/ScanPlot0dValue-c0dd01b5.js +1 -0
  39. daiquiri_ui/static/assets/ScanPlot1d-3c930b95.js +1 -0
  40. daiquiri_ui/static/assets/ScanPlot1d-ee33c98b.js +1 -0
  41. daiquiri_ui/static/assets/{ScanPlot2d-c857bbd7.js → ScanPlot2d-af57d8ad.js} +1 -1
  42. daiquiri_ui/static/assets/{ScanTable-11f74702.js → ScanTable-bc13760e.js} +1 -1
  43. daiquiri_ui/static/assets/ScanValue-00aab91b.js +1 -0
  44. daiquiri_ui/static/assets/SceneScale-e2a42af2.js +1 -0
  45. daiquiri_ui/static/assets/SchemaForm-7d897a32.js +1 -0
  46. daiquiri_ui/static/assets/{ScreenScale-fdd43179.js → ScreenScale-b2417934.js} +1 -1
  47. daiquiri_ui/static/assets/{SelectionPoint-7fbd4e1f.js → SelectionPoint-a2cb4dfc.js} +1 -1
  48. daiquiri_ui/static/assets/{StackedNameState-94be4a7b.js → StackedNameState-4e8dc742.js} +1 -1
  49. daiquiri_ui/static/assets/Statistics.worker-54a0d965.js +46 -0
  50. daiquiri_ui/static/assets/{Synoptic-d291a77a.js → Synoptic-8a3c67f3.js} +5 -5
  51. daiquiri_ui/static/assets/TomoAlign-b80a68c3.js +7 -0
  52. daiquiri_ui/static/assets/TomoBeamShaping-65a115e9.js +1 -0
  53. daiquiri_ui/static/assets/TomoDetector-500d46af.js +1 -0
  54. daiquiri_ui/static/assets/TomoDetector-e04a5a8b.js +1 -0
  55. daiquiri_ui/static/assets/TomoDetectorView-952499e6.js +64 -0
  56. daiquiri_ui/static/assets/TomoHolo-db2c8449.js +1 -0
  57. daiquiri_ui/static/assets/TomoPusherView-a50e2acd.js +1 -0
  58. daiquiri_ui/static/assets/TomoReconstructedSinogram-deee0779.js +191 -0
  59. daiquiri_ui/static/assets/TomoScanInfo-972a690b.js +1 -0
  60. daiquiri_ui/static/assets/{TomoScanList-66ecaec4.js → TomoScanList-ede05c2a.js} +1 -1
  61. daiquiri_ui/static/assets/TomoService-e9741d6a.js +1 -0
  62. daiquiri_ui/static/assets/TomoSinogram-dce5808e.js +1 -0
  63. daiquiri_ui/static/assets/TomoTiling-04701bb7.js +69 -0
  64. daiquiri_ui/static/assets/TwoD-fee9523f.js +3 -0
  65. daiquiri_ui/static/assets/TwoDObject-2f30deac.js +1 -0
  66. daiquiri_ui/static/assets/TwoDObjectList-458e4824.js +1 -0
  67. daiquiri_ui/static/assets/{UseMouseModeInteraction-9b6c111c.js → UseMouseModeInteraction-51c6269c.js} +1 -1
  68. daiquiri_ui/static/assets/VLineRoi-b38fe841.js +1 -0
  69. daiquiri_ui/static/assets/{VSegment-5d77576e.js → VSegment-f0d42c9a.js} +2 -2
  70. daiquiri_ui/static/assets/VSegmentRoi-d5e035cc.js +1 -0
  71. daiquiri_ui/static/assets/{VideoStream-b33f5afc.js → VideoStream-a5200b21.js} +1 -1
  72. daiquiri_ui/static/assets/{VisViewpointRestore-3a80fbce.js → VisViewpointRestore-4aa338ea.js} +3 -3
  73. daiquiri_ui/static/assets/{WorldScale-862ee5ba.js → WorldScale-23bd1dfb.js} +1 -1
  74. daiquiri_ui/static/assets/{ZoomPanCanvas-1365066d.js → ZoomPanCanvas-23b61dbb.js} +1 -1
  75. daiquiri_ui/static/assets/{colormap-0981f7dc.js → colormap-6e43299c.js} +1 -1
  76. daiquiri_ui/static/assets/fontawesomemore-webfont-6ae56ae3.woff2 +0 -0
  77. daiquiri_ui/static/assets/{geometry-252a228f.js → geometry-cd448ec1.js} +1 -1
  78. daiquiri_ui/static/assets/hooks-171c0765.js +1 -0
  79. daiquiri_ui/static/assets/{hooks-e8b12550.js → hooks-e0d9229c.js} +1 -1
  80. daiquiri_ui/static/assets/index-779a56ef.css +9 -0
  81. daiquiri_ui/static/assets/{index-19c84627.js → index-a9bb7636.js} +7 -7
  82. daiquiri_ui/static/assets/index-b3c0133a.js +3576 -0
  83. daiquiri_ui/static/assets/{plotly-basic-4f8b68a8.js → plotly-basic-ccc5794d.js} +1 -1
  84. daiquiri_ui/static/assets/{plotly-gl2d-14b9dcce.js → plotly-gl2d-345cb34a.js} +1 -1
  85. daiquiri_ui/static/assets/store-5d136a2c.js +1 -0
  86. daiquiri_ui/static/assets/{types-0be7083b.js → types-c366a377.js} +1 -1
  87. daiquiri_ui/static/index.html +2 -2
  88. daiquiri_ui/static/meta.json +1 -1
  89. {daiquiri_ui-2025.12.5.dist-info → daiquiri_ui-2026.2.0.dist-info}/METADATA +1 -1
  90. daiquiri_ui-2026.2.0.dist-info/RECORD +134 -0
  91. {daiquiri_ui-2025.12.5.dist-info → daiquiri_ui-2026.2.0.dist-info}/WHEEL +1 -1
  92. daiquiri_ui/static/assets/Anchor-f3716b7b.js +0 -1
  93. daiquiri_ui/static/assets/AutoscaleOption-e2ee098d.js +0 -1
  94. daiquiri_ui/static/assets/DraggableRect-8e897252.js +0 -1
  95. daiquiri_ui/static/assets/DropdownButton-9a594aef.js +0 -1
  96. daiquiri_ui/static/assets/DropdownDetector-705d3a9d.js +0 -1
  97. daiquiri_ui/static/assets/EditorTree-792b2d33.js +0 -1
  98. daiquiri_ui/static/assets/H5Viewer-6c3d85e4.js +0 -1
  99. daiquiri_ui/static/assets/HSegment-26c3fd51.js +0 -43
  100. daiquiri_ui/static/assets/HardwareButton-905ce384.js +0 -1
  101. daiquiri_ui/static/assets/Hdf5Plot-7b8f8e0f.js +0 -1
  102. daiquiri_ui/static/assets/Image-c1578ac2.js +0 -1
  103. daiquiri_ui/static/assets/Label-7daca8b6.js +0 -1
  104. daiquiri_ui/static/assets/NewScanButton-3ccc3031.js +0 -1
  105. daiquiri_ui/static/assets/NewScanButton-ed1679d8.js +0 -1
  106. daiquiri_ui/static/assets/OptionsProcess-9e8d1dd6.js +0 -1
  107. daiquiri_ui/static/assets/ParametersList-39837f0d.js +0 -1
  108. daiquiri_ui/static/assets/RectRoi-a627d206.js +0 -1
  109. daiquiri_ui/static/assets/RulerButton-ebbb7ca3.js +0 -139
  110. daiquiri_ui/static/assets/SampleDCList-03813f5f.js +0 -1
  111. daiquiri_ui/static/assets/SampleRegistration-6fad78fb.js +0 -1
  112. daiquiri_ui/static/assets/SavingButton-a220fa1e.js +0 -1
  113. daiquiri_ui/static/assets/ScanPlot0d-c78ff27c.js +0 -1
  114. daiquiri_ui/static/assets/ScanPlot0dValue-daa69216.js +0 -1
  115. daiquiri_ui/static/assets/ScanPlot1d-bdb2fdb1.js +0 -1
  116. daiquiri_ui/static/assets/ScanPlot1d-c0e49d26.js +0 -1
  117. daiquiri_ui/static/assets/ScanValue-a38a2ca1.js +0 -1
  118. daiquiri_ui/static/assets/SceneScale-47e8e288.js +0 -1
  119. daiquiri_ui/static/assets/SchemaForm-4a3d737e.js +0 -1
  120. daiquiri_ui/static/assets/TomoAlign-19546c0c.js +0 -5
  121. daiquiri_ui/static/assets/TomoBeamShaping-303f1af7.js +0 -1
  122. daiquiri_ui/static/assets/TomoDetector-42a6e14c.js +0 -1
  123. daiquiri_ui/static/assets/TomoDetectorView-bc556465.js +0 -64
  124. daiquiri_ui/static/assets/TomoHolo-dc83668f.js +0 -1
  125. daiquiri_ui/static/assets/TomoReconstructedSinogram-3aba7e83.js +0 -191
  126. daiquiri_ui/static/assets/TomoScanInfo-7235514b.js +0 -1
  127. daiquiri_ui/static/assets/TomoSinogram-3202ac53.js +0 -1
  128. daiquiri_ui/static/assets/TomoTiling-42ab8b24.js +0 -69
  129. daiquiri_ui/static/assets/TwoD-a488b0f5.js +0 -3
  130. daiquiri_ui/static/assets/TwoDObject-fbaffc6f.js +0 -1
  131. daiquiri_ui/static/assets/TwoDObjectList-7de7fa1d.js +0 -1
  132. daiquiri_ui/static/assets/VLineRoi-75cfdd39.js +0 -1
  133. daiquiri_ui/static/assets/colors-5bf0897d.js +0 -1
  134. daiquiri_ui/static/assets/fontawesomemore-webfont-97d0220a.woff2 +0 -0
  135. daiquiri_ui/static/assets/hooks-e7539055.js +0 -1
  136. daiquiri_ui/static/assets/index-4cf586ed.js +0 -3576
  137. daiquiri_ui/static/assets/index-f085dfca.css +0 -9
  138. daiquiri_ui/static/assets/store-2462c975.js +0 -1
  139. daiquiri_ui/static/resources/shaders/compare.frag.glsl +0 -386
  140. daiquiri_ui/static/resources/shaders/compare.vert.glsl +0 -11
  141. daiquiri_ui-2025.12.5.dist-info/RECORD +0 -128
  142. {daiquiri_ui-2025.12.5.dist-info → daiquiri_ui-2026.2.0.dist-info}/licenses/LICENSE +0 -0
  143. {daiquiri_ui-2025.12.5.dist-info → daiquiri_ui-2026.2.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,7 @@
1
+ import{r as m,j as e,aH as R,as as H,B as f,aJ as S,aK as Ee,aL as Ie,aM as Re,aN as ae,U as He,J as Ge,ag as xe,u as T,aO as ze,F as he,C as $,R as fe,aP as Pe,A as Be,aQ as $e,ad as Ve,aF as Xe,aE as We,a5 as qe,H as Qe}from"./index-b3c0133a.js";import{u as Ke}from"./ScanDataService-16f29ecd.js";import{u as Je,a as Ye,b as ye,c as je}from"./hooks-171c0765.js";import{u as Ze,a as et,T as ge,D as tt,S as pe,L as at}from"./UseMouseModeInteraction-51c6269c.js";import{D as x,A as ve,F as nt,u as st,a as rt,b as it,C as ot,H as Me,R as lt,c as ct,I as te,d as Ce}from"./RectRuler-1fee3fd8.js";import{V as dt}from"./VLineRoi-b38fe841.js";import{S as ut}from"./SceneScale-e2a42af2.js";import{S as Ae,L as mt,R as xt,a as ht}from"./RulerButton-a95a6035.js";import{A as E}from"./colormap-6e43299c.js";import{D as ft}from"./DropdownButton-29cc265b.js";import{L as yt}from"./LoadingMessage-03b4fa4f.js";import{A as Y}from"./Anchor-0b4a3d33.js";import{O as jt,h as gt}from"./index-a9bb7636.js";import{A as we}from"./DraggableRect-25d91c7d.js";import"./ScreenScale-b2417934.js";import"./VSegmentRoi-d5e035cc.js";import"./Label-9d8979b3.js";import"./QtyHelper-8429914f.js";import"./types-c366a377.js";function pt(n){const[t,a,r]=Je(n,{behavior:"destroyFuture"}),[l,i]=m.useState(void 0),o=m.useMemo(()=>({...t,...l}),[t,l]);function c(h,g){g?i(u=>({...u,...h})):(a(u=>({...u,...h})),i(()=>{}))}return[o,c,r]}function vt(n){const{config:t}=n;return e.jsxs(ft,{title:e.jsx("i",{title:"Extra options",className:"fa fa-sliders fa-fw fa-lg"}),variant:"secondary",children:[e.jsxs(R.Header,{children:[e.jsx("h5",{style:{width:"8em"},children:"Auto contrast"}),e.jsxs(H,{children:[e.jsx(f,{variant:t.autoscaleMode===E.None?"primary":"secondary",onClick:()=>{t.setAutoscaleMode(E.None)},children:"None"}),e.jsx(f,{variant:t.autoscaleMode===E.Minmax?"primary":"secondary",onClick:()=>{t.setAutoscaleMode(E.Minmax)},children:"Min/max"}),e.jsx(f,{variant:t.autoscaleMode===E.StdDev3?"primary":"secondary",onClick:()=>{t.setAutoscaleMode(E.StdDev3)},children:"3×std"})]})]}),e.jsx(R.Header,{children:e.jsxs(S,{direction:"horizontal",children:[e.jsx("h5",{style:{width:"8em"},children:"Vertical line"}),e.jsx(f,{title:"Show/hide a vertical line",variant:t.displayVLine?"primary":"secondary",onClick:()=>{t.setDisplayVLine(a=>!a)},children:e.jsx("i",{className:`fa ${t.displayVLine?"fa-eye":"fa-eye-slash"} fa-fw fa-lg`})})]})}),e.jsx(R.Header,{children:e.jsxs(S,{direction:"horizontal",children:[e.jsx("h5",{style:{width:"8em"},children:"Horizontal line"}),e.jsx(f,{title:"Show/hide an horizontal line",variant:t.displayHLine?"primary":"secondary",onClick:()=>{t.setDisplayHLine(a=>!a)},children:e.jsx("i",{className:`fa ${t.displayHLine?"fa-eye":"fa-eye-slash"} fa-fw fa-lg`})})]})}),e.jsx(R.Header,{children:e.jsxs(S,{direction:"horizontal",children:[e.jsx("h5",{style:{width:"8em"},children:"Show axes"}),e.jsx(f,{title:"Show/hide the axes",variant:t.displayAxes?"primary":"secondary",onClick:()=>{t.setDisplayAxes(!t.displayAxes)},children:e.jsx("i",{className:`fa ${t.displayAxes?"fa-eye":"fa-eye-slash"} fa-fw fa-lg`})})]})}),e.jsx(R.Header,{children:e.jsxs(S,{direction:"horizontal",children:[e.jsx("h5",{style:{width:"8em"},children:"Show custom shader"}),e.jsx(f,{title:"Show/hide custom shader",variant:t.displayCustomShader?"primary":"secondary",onClick:()=>{t.setDisplayCustomShader(!t.displayCustomShader)},children:e.jsx("i",{className:`fa ${t.displayCustomShader?"fa-eye":"fa-eye-slash"} fa-fw fa-lg`})})]})}),e.jsx(R.Header,{children:e.jsxs(S,{direction:"horizontal",children:[e.jsx("h5",{style:{width:"8em"},children:"Axis unit"}),e.jsxs(H,{children:[e.jsx(f,{title:"Display axis as pixel",variant:t.preferedUnit==="px"?"primary":"secondary",onClick:()=>{t.setPreferedUnit("px")},children:"px"}),e.jsx(f,{title:"Display axis as millimeter if possible",variant:t.preferedUnit==="mm"?"primary":"secondary",onClick:()=>{t.setPreferedUnit("mm")},children:"mm"}),e.jsx(f,{title:"Display axis as micrometer if possible",variant:t.preferedUnit==="um"?"primary":"secondary",onClick:()=>{t.setPreferedUnit("um")},children:"µm"})]})]})})]})}function Mt(n){const{value:t,onChanged:a,mixedMode:r,onMixedModeChanged:l}=n;function i(c){return c>=100&&c<300}function o(c){return e.jsx(f,{variant:t===c.value?"primary":"secondary",onClick:()=>{a(c.value),l(c.value)},children:c.children})}return e.jsxs(Ae,{title:e.jsx("i",{title:"Blend the two images",className:"fa fam-compare-mode fa-lg"}),variant:i(t)?"primary":"secondary",align:{lg:"start"},autoClose:!1,onClick:()=>{a(r)},children:[e.jsxs(R.Header,{children:[e.jsxs("h5",{children:[e.jsx("i",{className:"fa fam-compare-mode"})," Grey scale"]}),e.jsxs(H,{children:[e.jsx(o,{value:x.MIN,children:"Min"}),e.jsx(o,{value:x.MAX,children:"Max"}),e.jsx(o,{value:x.DIFF,children:"Diff"}),e.jsx(o,{value:x.ERROR,children:"Error"}),e.jsx(o,{value:x.MUL,children:"A×B"}),e.jsx(o,{value:x.HSPLITTER,children:"Split"})]})]}),e.jsxs(R.Header,{children:[e.jsxs("h5",{children:[e.jsxs("span",{className:"fa-stack",children:[e.jsx("i",{className:"fa fam-compare-mode-left fa-stack-1x",style:{color:"cyan"}}),e.jsx("i",{className:"fa fam-compare-mode-center fa-stack-1x"}),e.jsx("i",{className:"fa fam-compare-mode-right fa-stack-1x",style:{color:"lime"}})]})," ","Green & Cyan"]}),e.jsxs(H,{children:[e.jsx(o,{value:x.MIN_COLOR,children:"Min"}),e.jsx(o,{value:x.MAX_COLOR,children:"Max"}),e.jsx(o,{value:x.DIFF_COLOR,children:"Diff"}),e.jsx(o,{value:x.ERROR_COLOR,children:"Error"}),e.jsx(o,{value:x.MUL_COLOR,children:"A×B"}),e.jsx(o,{value:x.HSPLITTER_COLOR,children:"Split"})]})]})]})}function Ct(n){const{value:t,onChanged:a,mixedMode:r,onMixedModeChanged:l}=n;return e.jsxs(H,{children:[e.jsx(f,{variant:t===x.IMAGE_A?"info":"secondary",title:"Only display the image A",onClick:()=>{a(x.IMAGE_A)},children:e.jsx("i",{className:"fa fa-a fa-fw fa-lg"})}),e.jsx(f,{variant:t===x.IMAGE_B?"success":"secondary",title:"Only display the image B",onClick:()=>{a(x.IMAGE_B)},children:e.jsx("i",{className:"fa fa-b fa-fw fa-lg"})}),e.jsx(Mt,{value:t,onChanged:i=>{a(i)},mixedMode:r,onMixedModeChanged:l})]})}function wt(n){const t=m.useRef(n.defaultValue??""),[a,r]=m.useState(!1);function l(c){t.current=c,r(!0)}function i(){var c;(c=n.onChange)==null||c.call(n,t.current),r(!1)}const o=c=>{c.key==="Enter"&&c.ctrlKey&&i()};return Ee.useEffect(()=>(document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o)}),[]),e.jsxs(S,{direction:"vertical",gap:1,className:"mx-auto",children:[e.jsx("textarea",{rows:5,cols:40,defaultValue:t.current,onChange:c=>{l(c.target.value)}}),e.jsx(f,{variant:a?"primary":"secondary",onClick:()=>{i()},children:"Apply (Ctrl+Return)"})]})}function _t(n){const{value:t,onChanged:a,customFunc:r,onCustomFuncChanged:l}=n;return e.jsx(Ae,{title:e.jsx("i",{title:"Advanced blending based on custom webgl code",className:"fa fa-square-root-variable fa-fw fa-lg"}),variant:t===x.CUSTOM?"primary":"secondary",align:{lg:"start"},autoClose:!1,onClick:()=>{a(x.CUSTOM)},children:e.jsx(R.Header,{children:e.jsx(wt,{defaultValue:r,onChange:i=>{l(i)}})})})}function bt(n){const{nabu_method:t,nabu_lateral_corr:a,nabu_camera_tilt:r,nabu_exception:l}=n;return!t&&!a&&!r&&!l?null:{method:t,lateral_corr:a,camera_tilt:r,exception:l}}function St(n){return n==="um"?"μm":n}function It(n,t,a,r){return m.useMemo(()=>{function l(c){return c==="um"?"μm":c}function i(c){return c.toFixed(r).replace(/\.?0+$/,"")}if(n===null)return["∅",""];if(t===a)return[i(n),l(a)];const o=Ie(n,t);return[i(o.to(a).scalar),l(a)]},[n,t,a])}function _e(n){const{value:t=null,unit:a,displayUnit:r,style:l,className:i,decimals:o=2,title:c}=n,[h,g]=It(t,a,r??a,o);return e.jsxs("span",{style:l,className:i,title:`${t} ${a}
2
+ ${c??""}`,children:[h," ",St(g)]})}function Rt(n){var o;const{nabuCorrection:t,decimals:a=2,lateralUnit:r="mm",ignoreTilt:l}=n;if(t===null)return e.jsx(e.Fragment,{});const i=(o=t.exception)==null?void 0:o.message;return e.jsx(Re,{striped:!0,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{children:"Estimator"}),e.jsx("td",{children:t.method?"nabu":"none"})]}),e.jsxs("tr",{children:[e.jsx("td",{children:"Method"}),e.jsx("td",{children:t.method})]}),e.jsxs("tr",{children:[e.jsx("td",{children:"Lateral"}),e.jsx("td",{children:e.jsx(_e,{value:(t==null?void 0:t.lateral_corr)??0,unit:"mm",displayUnit:r,decimals:a})})]}),e.jsxs("tr",{children:[e.jsx("td",{children:"Tilt"}),e.jsx("td",{children:e.jsx(_e,{className:`${l?"text-bg-warning":""}`,value:(t==null?void 0:t.camera_tilt)??0,unit:"deg",decimals:a,title:l?`The layout is not setup to correct the tilt.
3
+ This correction will be ignored.`:void 0})})]}),i&&e.jsxs("tr",{children:[e.jsx("td",{children:"Failure?"}),e.jsx("td",{children:i})]})]})})}function At(n){const{lateral_motor:t,camera_tilt_motor:a}=n;return!t&&!a?null:{lateral_motor:t,camera_tilt_motor:a}}function Nt(n){const{parameters:t}=n,a=[{dataField:"name",text:"Name"},{dataField:"type",text:"Type"},{dataField:"value",text:"Content"}];function r(i){const o=typeof i;return o==="object"&&i!==null&&"__type__"in i?i.__type__:o}const l=Object.entries(t).map(([i,o])=>({name:i,type:r(o),value:JSON.stringify(o)}));return e.jsx(Ge,{keyField:"name",data:l,columns:a,noDataIndication:"No parameters"})}function Lt(n){const{parameters:t}=n,a=m.useRef(null),{procedureId:r,show:l,onClose:i}=n;return e.jsx(He,{show:l,target:a,title:`Procedure ${r}'s parameters`,showClose:!0,actions:{onClose:i},children:e.jsx(Nt,{parameters:t})})}function Dt(n){var o,c;const{procedureId:t,parameters:a}=n,r=At(a),[l,i]=m.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(Lt,{show:l,procedureId:t,parameters:a,onClose:()=>{i(!1)}}),e.jsx(Re,{striped:!0,children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{children:"Procedure"}),e.jsx("td",{children:t??"No procedure"})]}),!!r&&e.jsx(ae,{in:!!r,dimension:"height",children:e.jsxs(e.Fragment,{children:[e.jsxs("tr",{children:[e.jsx("td",{children:"Lateral axis"}),e.jsx("td",{children:(o=r.lateral_motor)==null?void 0:o.name})]}),e.jsxs("tr",{children:[e.jsx("td",{children:"Tilt axis"}),e.jsx("td",{children:(c=r.camera_tilt_motor)==null?void 0:c.name})]}),e.jsx("tr",{children:e.jsx("td",{colSpan:2,children:e.jsx(f,{className:"w-100",variant:"secondary",onClick:()=>{i(h=>!h)},title:"Display a details in a popup",size:"sm",children:"See details..."})})})]})})]})})]})}function be(n){const{head:t,tail:a,lineWidth:r=1,color:l="black",gapColor:i,dashSize:o=0,gapSize:c=o,opacity:h=1,zIndex:g=0,arrowHead:u,arrowTail:C}=n,p=m.useMemo(()=>{const I=t[0]-a[0],v=t[1]-a[1];if(!(I===0&&v===0))return Math.atan2(v,-I)*180/Math.PI},[t[0],t[1],a[0],a[1]]);return e.jsxs("group",{"position-z":g,children:[u&&p!==void 0&&e.jsx(ve,{x:t[0],y:t[1],sizeInScreen:we,angle:p+180,color:l,lineWidth:r}),C&&p!==void 0&&e.jsx(ve,{x:a[0],y:a[1],sizeInScreen:we,angle:p,color:l,lineWidth:r}),e.jsx(mt,{p1:a,p2:t,lineWidth:r,color:l,gapColor:i,dashSize:o,gapSize:c,opacity:h})]})}function kt(n){const{geometry:t,lineWidth:a=2,color:r="blue",color1:l=r,color2:i=r,opacity:o=1,zIndex:c=1,visible:h=!0,readOnly:g=n.onGeometryChanged===void 0,readOnly1:u=g,readOnly2:C=g}=n,p=m.useMemo(()=>{if(!h)return 0;const y=t.y11-t.y12,w=t.y21-t.y22,_=y===0?0:(t.x11-t.x12)/y,M=w===0?0:(t.x21-t.x22)/w;return Math.atan((M-_)/(1+_*M))*180/Math.PI},[t,h]),I=m.useMemo(()=>{if(!h)return"";const y=Math.abs(p);return y<.001?`${(y*1e6).toFixed(2)} µdeg`:y<1?`${(y*1e3).toFixed(2)} mdeg`:`${y.toFixed(2)} deg`},[p,h]);if(!h)return e.jsx(e.Fragment,{});function v(y,w){var d;const{x:_,y:M}=y;(d=n.onGeometryChanged)==null||d.call(n,{...t,x11:_,y11:M},w)}function F(y,w){var d;const{x:_,y:M}=y;(d=n.onGeometryChanged)==null||d.call(n,{...t,x12:_,y12:M},w)}function U(y,w){var d;const{x:_,y:M}=y;(d=n.onGeometryChanged)==null||d.call(n,{...t,x21:_,y21:M},w)}function A(y,w){var d;const{x:_,y:M}=y;(d=n.onGeometryChanged)==null||d.call(n,{...t,x22:_,y22:M},w)}const G=(t.x11+t.x12+t.x21+t.x22)*.25,L=(t.y11+t.y12+t.y21+t.y22)*.25;return e.jsxs(e.Fragment,{children:[e.jsx(be,{tail:[t.x11,t.y11],head:[t.x12,t.y12],lineWidth:a,color:l,opacity:o,zIndex:c,arrowHead:!0}),e.jsx(be,{tail:[t.x21,t.y21],head:[t.x22,t.y22],lineWidth:a,color:i,opacity:o,zIndex:c,arrowHead:!0}),!g&&e.jsxs(e.Fragment,{children:[e.jsx(Y,{geometry:{x:t.x11,y:t.y11},zIndex:c,color:l,opacity:o,visible:u,onGeometryChanged:v}),e.jsx(Y,{geometry:{x:t.x12,y:t.y12},zIndex:c,color:l,opacity:o,visible:u,onGeometryChanged:F}),e.jsx(Y,{geometry:{x:t.x21,y:t.y21},zIndex:c,color:i,opacity:o,visible:C,onGeometryChanged:U}),e.jsx(Y,{geometry:{x:t.x22,y:t.y22},zIndex:c,color:i,opacity:o,visible:C,onGeometryChanged:A})]}),e.jsx(jt,{x:G,y:L,style:{zIndex:100},center:!0,children:e.jsx("div",{className:"text-light p-1 rounded",style:{backgroundColor:"#000000A0"},children:I})})]})}function Se(n,t){const a=new xe(t.x-n.x,t.y-n.y),r=a.length();a.normalize();const l=new xe(a.y,-a.x);return{x11:n.x,y11:n.y,x12:t.x,y12:t.y,x21:n.x+a.x*r*.1+l.x*r*.2,y21:n.y+a.y*r*.1+l.y*r*.2,x22:t.x+-a.x*r*.1+l.x*r*.2,y22:t.y+-a.y*r*.1+l.y*r*.2}}function Ot(n){const{enabled:t=!0,setIntermediateRoi:a,setRoi:r}=n,l=Ze();return e.jsx(gt,{id:"selection-tool-a2l",disabled:!t,onSelectionChange:i=>{if(i===void 0)return;const o=Se(i.data[0],i.data[1]);a==null||a(o)},onSelectionStart:()=>{l==null||l.actions.captureMouseInteraction()},onSelectionEnd:()=>{l==null||l.actions.releaseMouseInteraction()},onValidSelection:i=>{const o=Se(i.data[0],i.data[1]);r(o)},children:i=>e.jsx(e.Fragment,{})})}function Tt(n){var de,ue,me;const{imageA:t,imageB:a,config:r,procedureId:l,parameters:i,procedure:o,ignoreTilt:c=!1,decimals:h=2,lateralUnit:g="um",pixelSize:u}=n,C=m.useRef(null),[p,I]=T("tomo/align/mixedmode",x.MIN_COLOR),[v,F]=T("tomo/align/displaymode",x.MIN_COLOR),[U,A]=m.useState(void 0),[G,L]=m.useState(void 0),[y,w]=m.useState(0),[_,M]=m.useState(0),d=et("zoom"),{mouseMode:j}=d,[D,N]=m.useState(void 0),[V,Q]=m.useState(nt.NONE),[ne,Ne]=m.useState(0),[se,Le]=m.useState(`// a: Intensity from image A, [0..1], -1 = out
4
+ // b: Intensity from image B, [0..1], -1 = out
5
+ // return: R, G, B, alpha values, [0..1]
6
+ return vec4(a, b, 0.0, 1.0);`),X=Ye(),re=ze(o.id),[De,K,W]=pt({lateralMM:0,tiltRad:0}),ie=m.useCallback(()=>{W.reset({lateralMM:i.nabu_lateral_corr??0,tiltRad:(c?0:i.nabu_camera_tilt??0)*(Math.PI/180)})},[i.nabu_lateral_corr??0,i.nabu_camera_tilt??0]);m.useEffect(()=>{ie()},[i.nabu_lateral_corr??0,i.nabu_camera_tilt??0]);const{tiltRad:z,lateralMM:k}=De,[b,O]=m.useMemo(()=>u===void 0?["px",void 0]:r.preferedUnit==="px"?["px",u.to("mm").scalar]:[r.preferedUnit,u.to("mm").scalar],[r.preferedUnit,u]);st({updateRoi:A,tiltRad:z,lateralMM:-k,pixelSize:b==="px"||u==null?void 0:u.to(b)}),rt({updateRoi:L,pixelSize:b==="px"||u==null?void 0:u.to(b)});function oe(s){K({tiltRad:s},!0)}function J(s){K({lateralMM:s},!0)}function le(s){K({tiltRad:s},!1)}function P(s){K({lateralMM:s},!1)}m.useEffect(()=>{var s;(s=C.current)==null||s.actions.clearLater()},[t,a]);const[Z,ee]=((de=t==null?void 0:t[0])==null?void 0:de.shape)??[1024,1024],{abscissaConfig:ke,ordinateConfig:Oe}=m.useMemo(()=>{var B;const s=b==="px"?1:((B=u==null?void 0:u.to(b))==null?void 0:B.scalar)??1;return{abscissaConfig:{visDomain:[-ee*s*.8,ee*s*.8],label:`x (${b})`},ordinateConfig:{visDomain:[-Z*s*.6,Z*s*.6],label:`y (${b})`}}},[ee,Z,b,u]),q=((ue=o.properties)==null?void 0:ue.state)==="AWAITING_USER_INPUT",Te=((me=o.properties)==null?void 0:me.state)==="ABORTING",Fe=o.properties.state==="RUNNING"||q||Te,ce=bt(i);m.useEffect(()=>{!q&&d.mouseMode==="move-lateral"&&d.resetMouseMode()},[q]);const Ue=m.useMemo(()=>({"move-lateral":"ew-resize"}),[]);return e.jsxs(S,{direction:"horizontal",gap:2,onKeyDown:s=>{s.key===" "&&(F(B=>B===x.IMAGE_A?x.IMAGE_B:x.IMAGE_A),s.preventDefault()),s.key==="ArrowLeft"&&(P(k-(O??0)*.5),s.preventDefault()),s.key==="ArrowRight"&&(P(k+(O??0)*.5),s.preventDefault())},tabIndex:-1,style:n.style,children:[e.jsxs(S,{direction:"vertical",style:{alignSelf:"stretch",flexGrow:4,minWidth:0},children:[e.jsxs(ge,{align:"center",style:{zIndex:1},children:[e.jsx(tt,{mouseModeInteraction:d}),e.jsxs(H,{children:[e.jsx(f,{title:"Reset zoom",variant:"secondary",onClick:()=>{var s;(s=C==null?void 0:C.current)==null||s.actions.resetZoom()},children:e.jsx("i",{className:"fa fa-expand fa-fw fa-lg"})}),e.jsx(f,{disabled:!X[2].canUndo,title:"Undo the last changes applied to the corrections",onClick:()=>{X[2].undo()},variant:"secondary",children:e.jsx("i",{className:"fa fa-reply fa-fw fa-lg"})}),e.jsx(f,{disabled:!X[2].canRedo,title:"Redo the last reverted changes applied to the corrections",onClick:()=>{X[2].redo()},variant:"secondary",children:e.jsx("i",{className:"fa fa-share fa-fw fa-lg"})})]}),e.jsx(pe,{}),e.jsxs(xt,{mouseModeInteraction:d,extraMouseModes:{"measure-angle2line":"fam-protractor2","measure-rect":"fam-roi-rect"},onClear:()=>{A(void 0),L(void 0)},children:[e.jsxs(R.Item,{active:j==="measure-angle2line",onClick:()=>{d.setMouseMode("measure-angle2line")},title:"Measure an angle between 2 lines",children:[e.jsx("i",{className:"fa fa-fw fam-protractor2 fa-lg"}),"Measure angle (2 lines)"]}),e.jsxs(R.Item,{active:j==="measure-rect",onClick:()=>{d.setMouseMode("measure-rect")},title:"Measure with a rectangle selection",children:[e.jsx("i",{className:"fa fa-fw fam-roi-rect fa-lg"}),"Measure rectangle"]})]}),e.jsx(Ct,{value:v,onChanged:s=>{F(s)},mixedMode:p,onMixedModeChanged:I}),r.displayCustomShader&&e.jsx(_t,{value:v,onChanged:s=>{F(s)},customFunc:se,onCustomFuncChanged:s=>{Le(s)}}),e.jsx(it,{value:V,onSelect:s=>{Q(s)}}),e.jsx(pe,{}),e.jsx(vt,{config:r})]}),e.jsx(m.Suspense,{fallback:null,children:e.jsxs(at,{undoableViewpoint:X,plotRef:C,abscissaConfig:ke,ordinateConfig:Oe,aspect:"equal",showAxes:r.displayAxes,onMouseInteractionOverlayChanged:N,cursors:Ue,mouseMode:j,children:[e.jsx(ut,{unit:b}),e.jsx(yt,{loading:n.loading,warning:t===void 0||a===void 0?"No data":void 0,danger:n.loading?void 0:n.error}),t&&a&&e.jsx(ot,{imageA:t[0],imageB:a[0],stateA:t[1],stateB:a[1],displayMode:v,imageATranslationX:-k/(O??1),imageARotation:z,imageBTranslationX:k/(O??1),imageBRotation:-z,imageBFlipX:!0,pixelSize:b==="px"?void 0:(u==null?void 0:u.to(b).scalar)??void 0,onTranslationXChanged:(s,B)=>{P(-s*(O??0))},onTranslationXIntermediateChanged:(s,B)=>{J(-s*(O??0))},autoScale:r.autoscaleMode,verticalSeparator:ne,customFunc:se,filterMode:V,translationXInteration:D===void 0&&j==="move-lateral"&&O!==void 0}),e.jsx(dt,{geometry:{x:y},onGeometryChanged:s=>{w(s.x)},visible:r.displayVLine}),e.jsx(Me,{geometry:{y:_},onGeometryChanged:s=>{M(s.y)},visible:r.displayHLine}),U&&e.jsx(kt,{geometry:U,onGeometryChanged:s=>{A(s)},color1:"#00FFFF",color2:"#00FF00",readOnly1:v!==x.IMAGE_B,readOnly2:v!==x.IMAGE_A}),G&&e.jsx(lt,{geometry:G,onGeometryChanged:s=>{L(s)},color:"red",unit:b}),e.jsx(Me,{geometry:{y:ne},color:"red",onGeometryChanged:s=>{Ne(s.y)},visible:v===x.HSPLITTER||v===x.HSPLITTER_COLOR}),e.jsx(ht,{mouseMode:j,disabled:D!==void 0,plotUnit:b}),e.jsx(Ot,{enabled:j==="measure-angle2line",setIntermediateRoi:s=>{A(s)},setRoi:s=>{A(s),d.resetMouseMode()}}),e.jsx(ct,{enabled:j==="measure-rect",setIntermediateRoi:s=>{L(s)},setRoi:s=>{L(s),d.resetMouseMode()}})]})})]}),e.jsxs(S,{style:{width:"20em",overflow:"hidden auto"},className:"mt-4",direction:"vertical",gap:2,children:[e.jsxs("div",{children:[e.jsx("h4",{children:"Description"}),e.jsx(Dt,{procedureId:l??null,parameters:i})]}),e.jsx(ae,{in:!!ce,dimension:"height",children:e.jsxs("div",{children:[e.jsx("h4",{children:"Estimation"}),e.jsx(Rt,{nabuCorrection:ce,lateralUnit:g,decimals:h,ignoreTilt:c})]})}),e.jsx(ae,{in:q,dimension:"height",children:e.jsxs("div",{children:[e.jsx("h4",{children:"Correction"}),e.jsxs(ge,{align:"center",children:[e.jsx(f,{className:"me-1",variant:j==="move-lateral"?"primary":"secondary",title:"Shift the two images to compare and edit the ROIs",onClick:()=>{d.setOrResetMouseMode("move-lateral")},children:e.jsx("i",{className:"fa fa-arrow-right-arrow-left fa-fw fa-lg"})}),e.jsxs(H,{children:[e.jsx(f,{disabled:!W.canUndo,title:"Undo the last changes applied to the corrections",onClick:()=>{W.undo()},variant:"secondary",children:e.jsx("i",{className:"fa fa-reply fa-fw fa-lg"})}),e.jsx(f,{disabled:!W.canRedo,title:"Redo the last reverted changes applied to the corrections",onClick:()=>{W.redo()},variant:"secondary",children:e.jsx("i",{className:"fa fa-share fa-fw fa-lg"})})]}),e.jsx(f,{className:"ms-1",variant:"secondary",title:"Use the nabu correction",onClick:()=>{ie()},children:e.jsx("i",{className:"fa fa-ranking-star fa-fw fa-lg"})})]}),e.jsxs(S,{direction:"horizontal",gap:2,className:"mt-3",style:{alignItems:"stretch"},children:[e.jsx(he.Label,{className:"h5",style:{width:"5em"},children:"Lateral"}),e.jsx($,{children:e.jsxs(S,{direction:"vertical",gap:2,children:[e.jsx(te,{value:k,unit:"mm",preferedDisplayUnit:g,step:.01,decimals:h,onChange:s=>{P(s)},onIntermediateChange:s=>{J(s)}}),e.jsx(te,{value:k,unit:"mm",decimals:h,preferedDisplayUnit:"px",pixelSize:u,step:.01,onChange:s=>{P(s)},onIntermediateChange:s=>{J(s)}}),e.jsxs(fe,{title:"Tune the correction around a pixel",children:[e.jsxs($,{sm:"2",children:[e.jsx("i",{className:"fa fa-fw fa-plus-minus"}),"1"]}),e.jsx($,{sm:"10",children:e.jsx(Ce,{value:k,range:2*(O??1),step:.001*(O??1),onChange:s=>{P(s)},onIntermediateChange:s=>{J(s)},title:"Tune the correction around a pixel"})})]})]})})]}),!c&&e.jsxs(S,{direction:"horizontal",gap:2,className:"mt-3",style:{alignItems:"stretch"},children:[e.jsx(he.Label,{className:"h5",style:{width:"5em"},children:"Tilt"}),e.jsx($,{children:e.jsxs(S,{direction:"vertical",gap:2,children:[e.jsx(te,{step:.01,value:z,unit:"rad",decimals:h,displayUnit:"deg",onChange:s=>{le(s)},onIntermediateChange:s=>{oe(s)}}),e.jsxs(fe,{children:[e.jsxs($,{sm:"2",children:[e.jsx("i",{className:"fa fa-fw fa-plus-minus"}),"1"]}),e.jsx($,{sm:"10",title:"Tune the correction around a degree",children:e.jsx(Ce,{value:z,range:2*Math.PI/180,step:.001*Math.PI/180,onChange:s=>{le(s)},onIntermediateChange:s=>{oe(s)},title:"Tune the correction around a degree"})})]})]})})]}),e.jsxs(S,{className:"mx-auto mt-4 justify-content-center",direction:"horizontal",gap:2,children:[e.jsx(f,{variant:"danger",size:"lg",disabled:!q,onClick:()=>{re.call("validate",{lateral_corr:k,camera_tilt:c?null:z*180/Math.PI})},title:"This will apply the correction to the axes of the beamline",children:"Apply corrections"}),e.jsx(f,{size:"lg",onClick:()=>{re.call("abort")},disabled:!Fe,children:"Abort"})]})]})})]})]})}function Ft(){const[n,t]=T("tomo/align/colormap/autoscalemode",E.StdDev3),[a,r]=T("tomo/align/axes",!0),[l,i]=T("tomo/align/vline",!1),[o,c]=T("tomo/align/hline",!1),[h,g]=T("tomo/align/crosshair",!1),[u,C]=T("tomo/align/preferedunit","mm"),[p,I]=T("tomo/align/customshader",!1);return{autoscaleMode:n,setAutoscaleMode:t,displayAxes:a,setDisplayAxes:r,displayVLine:l,setDisplayVLine:i,displayHLine:o,setDisplayHLine:c,crossHair:h,setCrossHair:g,preferedUnit:u,setPreferedUnit:C,displayCustomShader:p,setDisplayCustomShader:I}}$e("daiquiri.components.tomo.TomoAlign");function Ut(n){var M;const{options:t}=n,a=Ft(),{procedure:r,ignoretilt:l=!1,decimals:i,lateralunit:o}=t,c=Pe(r??""),h=(c==null?void 0:c.properties)??{},g=(h==null?void 0:h.parameters)??{},u=(M=g.data_scan)==null?void 0:M.key,C=m.useMemo(()=>{if(g.pixel_size_mm!==void 0)return new Ie(g.pixel_size_mm,"mm")},[g.pixel_size_mm]),p=Ke({scanId:u,channelNames:["proj0","proj0_min","proj0_max","proj0_min_positive","proj0_mean","proj0_std","proj180","proj180_min","proj180_max","proj180_min_positive","proj180_mean","proj180_std"],start:0,stop:1});function I(d){var D,N;if(((D=p==null?void 0:p.request)==null?void 0:D.scanId)!==u)return;const j=(N=p.data[d])==null?void 0:N.pick(0,null,null);return j&&je(j)}function v(d){var N;const j=(N=p.data[d])==null?void 0:N.pick(0,null,null);return j===void 0?void 0:je(j).data[0]}function F(d){const j=v(`${d}_min`),D=v(`${d}_max`),N=v(`${d}_min_positive`),V=v(`${d}_mean`),Q=v(`${d}_std`);if(!(j===void 0||D===void 0||N===void 0||V===void 0||Q===void 0))return{min:j,max:D,mean:V,std:Q,minPositive:N}}const U=I("proj0"),A=I("proj180"),G=F("proj0"),L=F("proj180");function y(d,j){return m.useMemo(()=>{if(!(d===void 0||j===void 0))return[d,j]},[d,j])}const w=y(U,G),_=y(A,L);try{ye(U),ye(A)}catch{return e.jsx(e.Fragment,{children:"Image data unsupported"})}return c===null?e.jsxs(Be,{variant:"danger",children:["Procedure ",r," is not available"]}):e.jsx(Tt,{procedureId:r,config:a,procedure:c,parameters:g,pixelSize:C,imageA:w,imageB:_,loading:p.loading,error:p.errors?p.errors.join(`
7
+ `):void 0,ignoreTilt:l,decimals:i,lateralUnit:o,style:{flexGrow:1,flexShrink:1,minWidth:0,minHeight:0,alignSelf:"stretch",width:"100%",height:"100%"}})}function Et(n){return e.jsx(Ut,{...n})}function sa(n){const{yamlNode:t,procedure:a,ignoretilt:r,decimals:l,lateralunit:i,...o}=n;Ve(t,"procedure",a),Xe(t,"ignoretilt",r),We(t,"decimals",l),qe(t,"lateralunit",i),Qe(t,o);const c={procedure:a,ignoretilt:r,decimals:l,lateralunit:i};return e.jsx(Et,{options:c})}export{sa as default};
@@ -0,0 +1 @@
1
+ var Te=Object.defineProperty;var Fe=(s,n,i)=>n in s?Te(s,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[n]=i;var H=(s,n,i)=>(Fe(s,typeof n!="symbol"?n+"":n,i),i);import{r as f,j as e,aD as $,aH as q,i as xe,R as I,C as p,as as T,B as J,u as D,aR as Pe,aS as He,aT as Ie,aJ as qe,ad as Ee,H as Be}from"./index-b3c0133a.js";import{I as Oe,A as ze}from"./AutoscaleOption-3cb99678.js";import{a as Ue,L as We,b as Le,T as ee,D as Ae,S as Ge}from"./UseMouseModeInteraction-51c6269c.js";import{O as fe,F as ge,a as je,k as Ye,l as ne,H as ae,m as $e,U as Qe,n as Ve,w as Ke}from"./index-a9bb7636.js";import{R as _e}from"./RectRoi-3693cc65.js";import{N as ve,d as pe,e as ye,t as Me}from"./hooks-171c0765.js";import{u as Je,a as Xe,b as Ze}from"./TomoDetector-e04a5a8b.js";import{D as es}from"./DropdownDetector-5016908a.js";import{O as ss}from"./OptionsProcess-da629bfb.js";import{T as x,a as U}from"./ColorMap-be59ad21.js";import{u as ts}from"./colormap-6e43299c.js";import{L as ns}from"./LoadingMessage-03b4fa4f.js";import"./Image-ee61818a.js";import"./Anchor-0b4a3d33.js";import"./ScreenScale-b2417934.js";import"./DraggableRect-25d91c7d.js";import"./VSegmentRoi-d5e035cc.js";function as(){return new Worker("/assets/Statistics.worker-54a0d965.js")}class is{constructor(){H(this,"worker");H(this,"actualRequest",null);H(this,"settingRequest",!1);H(this,"queueId",0);H(this,"queues",{});if(!window.Worker)throw new Error("Unsupported Worker");this.worker=new as,this.worker.onmessage=this.onMessage.bind(this)}onMessage(n){const i=this.actualRequest;if(!i)return;this.actualRequest=null;const{result:t,error:o}=n.data;o!==void 0?i[1](o):i[0](t),this.processNextMessage()}createQueue(n){const i=this.queueId++;return this.queues[i]=n,i}removeQueue(n){delete this.queues[n]}queueUpdated(){this.actualRequest||this.processNextMessage()}processNextMessage(){for(const[n,i]of Object.entries(this.queues))if(i(this))break}async postMessage(n){if(this.actualRequest!==null||this.settingRequest)throw new Error("A job is already processing");return this.settingRequest=!0,new Promise((i,t)=>{this.actualRequest=[i,t],this.settingRequest=!1,this.worker.postMessage(n)})}}const De=f.createContext(null);function os(s){const n=f.useMemo(()=>new is,[]);return e.jsx(De.Provider,{value:{worker:n},children:s.children})}function rs(){var n;const s=(n=f.useContext(De))==null?void 0:n.worker;if(!s)throw new Error("No worker context is in the scope");return s}function we(s,n,i){const[t,o]=f.useState([null,"none"]),r=rs(),l=f.useRef();return f.useEffect(()=>{function c(h){const d=l.current;if(!d)return!1;const g={process:s,args:d};return l.current=void 0,h.postMessage(g).then(m=>{o(v=>[m,l.current===void 0?"successed":"requested"])}).catch(m=>{o([null,"error"])}),!0}const u=r.createQueue(c);return()=>{r.removeQueue(u)}},[r]),f.useEffect(()=>{const c=n();if(c===void 0){o([null,"none"]);return}o(u=>[u[0],"requested"]),l.current=c,r.queueUpdated()},i),t}function Ne(s){return s.data.buffer instanceof SharedArrayBuffer?s:(console.warn("An image is shared to a worker without using SharedArrayBuffer. Skipped."),null)}function ls(s,n){return we("computeMean",()=>{if(!(!s||!n)&&!(s instanceof ve)&&!(s instanceof pe)&&Ne(s))return[s,n]},[s,n])}function Q(s,n){return we("computeSumN",()=>{if(!(!s||!n)&&!(s instanceof ve)&&!(s instanceof pe)&&Ne(s))return[s,n]},[s,n])}function V(s){const{geometry:n,image:i}=s,[t,o]=ls(i,n);return e.jsxs(e.Fragment,{children:[t!==null&&e.jsx(fe,{x:Math.min(n.x1,n.x2),y:Math.min(n.y1,n.y2),children:e.jsx("div",{className:"ms-2 mt-2",title:"Mean grey level",children:e.jsxs("div",{className:"bg-dark text-light p-1 rounded font-tabular-nums",children:[e.jsx("i",{className:"fa-solid fa-circle-half-stroke fa-fw fa-lg"}),t.mean.toFixed(2)]})})}),e.jsx(_e,{...s})]})}function K(s,n){return s===null?n:n===null?s:{sum:s.sum+n.sum,n:s.n+n.n}}function _(s){return s===null?null:s.sum/s.n}function cs(s){const{geometry00:n,geometry01:i,geometry10:t,geometry11:o,image:r}=s,[l,c]=Q(r,n),[u,h]=Q(r,i),[d,g]=Q(r,t),[m,v]=Q(r,o);if(l===null&&u===null&&d===null&&m===null)return e.jsx(e.Fragment,{});const a=l,y=u,E=d,B=m;function F(L){return`${Math.abs(L).toFixed(1)}`}const ie=_(K(y,a))??0,O=_(K(B,E))??0,W=_(K(a,E))??0,z=_(K(y,B))??0,S=ie-O,w=W-z;return e.jsx(e.Fragment,{children:e.jsx("table",{cellSpacing:10,className:"mt-3",children:e.jsxs("tbody",{children:[e.jsxs("tr",{children:[e.jsx("td",{children:" "}),e.jsx("td",{children:" "}),e.jsxs("td",{className:"text-center",style:{width:"5em"},children:["Top",w>0&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),"+",F(w)]})]}),e.jsx("td",{children:" "}),e.jsx("td",{children:" "})]}),e.jsxs("tr",{children:[e.jsx("td",{children:" "}),e.jsx("td",{children:" "}),e.jsx("td",{className:"text-center",children:w>0?e.jsx($,{bg:"info",title:"More intensity on top",children:"↑"}):" "}),e.jsx("td",{children:" "}),e.jsx("td",{children:" "})]}),e.jsxs("tr",{children:[e.jsxs("td",{className:"pe-2 text-center",style:{width:"5em"},children:["Left",S>0&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),"+",F(S)]})]}),e.jsx("td",{children:S>0?e.jsx($,{bg:"info",title:"More intensity on left",children:"←"}):" "}),e.jsx("td",{children:" "}),e.jsx("td",{children:S<0?e.jsx($,{bg:"info",title:"More intensity on right",children:"→"}):" "}),e.jsxs("td",{className:"ps-2 text-center",style:{width:"5em"},children:["Right",S<0&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),"+",F(-S)]})]})]}),e.jsxs("tr",{children:[e.jsx("td",{children:" "}),e.jsx("td",{children:" "}),e.jsx("td",{className:"text-center",children:w<0?e.jsx($,{bg:"info",title:"More intensity on bottom",children:"↓"}):" "}),e.jsx("td",{children:" "}),e.jsx("td",{children:" "})]}),e.jsxs("tr",{children:[e.jsx("td",{children:" "}),e.jsx("td",{children:" "}),e.jsxs("td",{className:"ps-2 text-center",style:{width:"5em"},children:["Bottom",w<0&&e.jsxs(e.Fragment,{children:[e.jsx("br",{}),"+",F(-w)]})]}),e.jsx("td",{children:" "}),e.jsx("td",{children:" "})]})]})})})}function ds(s,n){return s===n?"primary":"secondary"}function N(s){return e.jsx(J,{variant:ds(s.var,s.value),onClick:()=>{s.setter(s.value)},className:"text-nowrap",size:"sm",children:s.children})}function us(s){const{as:n=void 0,variant:i="secondary",config:t}=s;return e.jsxs(q,{as:n,children:[e.jsx(q.Toggle,{id:"dropdown-basic",variant:i,className:"d-flex align-items-center",children:e.jsx("i",{className:"fa fa-sliders fa-fw fa-lg"})}),e.jsx(q.Menu,{className:"dropdown-menu-center",children:e.jsx("div",{className:"ms-1 me-1",style:{minWidth:"300px"},children:e.jsxs(xe,{children:[e.jsxs(I,{children:[e.jsx(p,{className:"my-auto",children:"Display axes"}),e.jsx(p,{xs:7,children:e.jsxs(T,{children:[e.jsx(N,{var:t.displayAxes,value:!0,setter:t.setDisplayAxes,children:"Yes"}),e.jsx(N,{var:t.displayAxes,value:!1,setter:t.setDisplayAxes,children:"No"})]})})]}),e.jsxs(I,{className:"mt-1",children:[e.jsx(p,{className:"my-auto",children:"Crosshair"}),e.jsx(p,{xs:7,children:e.jsxs(T,{children:[e.jsx(N,{var:t.crossHair,value:!0,setter:t.setCrossHair,children:"Yes"}),e.jsx(N,{var:t.crossHair,value:!1,setter:t.setCrossHair,children:"No"})]})})]}),e.jsxs(I,{className:"mt-1",children:[e.jsx(p,{className:"my-auto",children:"Mean level"}),e.jsx(p,{xs:7,children:e.jsxs(T,{children:[e.jsx(N,{var:t.displayMean,value:!0,setter:t.setDisplayMean,children:"Show"}),e.jsx(N,{var:t.displayMean,value:!1,setter:t.setDisplayMean,children:"Hide"})]})})]}),e.jsxs(I,{className:"mt-1",children:[e.jsx(p,{className:"my-auto",children:"Timestamp"}),e.jsx(p,{xs:7,children:e.jsxs(T,{children:[e.jsx(N,{var:t.displayEpoch,value:!0,setter:t.setDisplayEpoch,children:"Show"}),e.jsx(N,{var:t.displayEpoch,value:!1,setter:t.setDisplayEpoch,children:"Hide"})]})})]}),e.jsxs(I,{className:"mt-1",children:[e.jsx(p,{className:"my-auto",children:"Histogram"}),e.jsx(p,{xs:7,children:e.jsxs(T,{children:[e.jsx(N,{var:t.displayHistogram,value:!0,setter:t.setDisplayHistogram,children:"Show"}),e.jsx(N,{var:t.displayHistogram,value:!1,setter:t.setDisplayHistogram,children:"Hide"})]})})]})]})})})]})}function ms(){const[s,n]=D("tomo/detectorview/axes",!0),[i,t]=D("tomo/detectorview/crosshair",!1),[o,r]=D("tomo/detectorview/mean",!0),[l,c]=D("tomo/detectorview/epoch",!1),[u,h]=D("tomo/detectorview/histogram",!1),[d,g]=D("tomo/beamshaping/rois/marging-percent",.1);return{displayAxes:s,setDisplayAxes:n,crossHair:i,setCrossHair:t,displayMean:o,setDisplayMean:r,displayEpoch:l,setDisplayEpoch:c,displayHistogram:u,setDisplayHistogram:h,roiMarginPencent:d,setRoiMarginPencent:g}}function se(s,n){return s===void 0?"":Math.round(s)===s?s.toFixed(0):s.toFixed(n)}function hs(s,n){switch(n){case x.Dark:case x.Flat:case x.Proj:return[se(s,0),"count"];case x.FlatfieldNorm:case x.ProjDarkNorm:case x.ProjFlatNorm:case x.ProjNorm:return[se(s,2),"count/s"];default:return[se(s,2),""]}}function xs(s){const[n,i]=hs(s.pixel,s.dataKind);return e.jsx("table",{children:e.jsxs("tbody",{children:[e.jsxs("tr",{className:"flex-nowrap text-nowrap",children:[e.jsx("td",{className:"pe-2",children:"Coord x/y"}),e.jsxs("td",{className:"text-end",children:[s.px.toFixed(0)," × ",s.py.toFixed(0)]}),e.jsx("td",{className:"text-start",children:"px"})]}),s.pixel!==void 0&&e.jsxs("tr",{className:"flex-nowrap text-nowrap",children:[e.jsx("td",{className:"pe-2",children:"Intensity"}),e.jsx("td",{className:"text-end",children:n}),e.jsx("td",{className:"text-start",children:i})]})]})})}function fs(s){const{x:n,y:i,showMean:t,mean:o,showEpoch:r,epoch:l}=s,c=f.useMemo(()=>{if(l!==void 0)return new Date(l*1e3)},[l]);if(!r&&(!t||o===void 0))return e.jsx(e.Fragment,{});function u(h){return h===void 0?"Undefined":`${h.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:1})}`}return e.jsxs(fe,{x:n,y:i,children:[t&&o!==void 0&&e.jsx("div",{className:"ms-2 mt-2",title:"Mean grey level",children:e.jsxs("div",{className:"bg-dark text-light p-1 rounded font-tabular-nums",children:[e.jsx("i",{className:"fa-solid fa-circle-half-stroke fa-fw fa-lg"})," ",o.toFixed(2)]})}),r&&e.jsx("div",{className:"ms-2 mt-2",title:`Timestamp (${(c==null?void 0:c.toUTCString())??"undefined"})`,children:e.jsxs("div",{className:"bg-dark text-light p-1 rounded font-tabular-nums",children:[e.jsx("i",{className:"fa-solid fa-clock fa-fw fa-lg"})," ",u(c)]})})]})}function gs(s,n){return s===n?"primary":"secondary"}function te(s){return e.jsx(J,{variant:gs(s.var,s.value),onClick:()=>{s.setter(s.value)},className:"text-nowrap",size:"sm",children:s.children})}function js(s){const{as:n=void 0,variant:i="secondary",config:t}=s;return e.jsxs(q,{as:n,children:[e.jsx(q.Toggle,{id:"dropdown-basic",variant:i,className:"d-flex align-items-center",children:e.jsx("i",{className:"fa fa-sliders fa-fw fa-lg"})}),e.jsx(q.Menu,{className:"dropdown-menu-center",children:e.jsx("div",{className:"ms-1 me-1",style:{minWidth:"300px"},children:e.jsx(xe,{children:e.jsxs(I,{children:[e.jsx(p,{className:"my-auto",children:"ROI margins"}),e.jsx(p,{xs:7,children:e.jsxs(T,{children:[e.jsx(te,{var:t.roiMarginPencent,value:.01,setter:t.setRoiMarginPencent,children:"1%"}),e.jsx(te,{var:t.roiMarginPencent,value:.05,setter:t.setRoiMarginPencent,children:"5%"}),e.jsx(te,{var:t.roiMarginPencent,value:.1,setter:t.setRoiMarginPencent,children:"10%"})]})})]})})})})]})}const de=[.1,1];function vs(s){const{histogram:n,scaleType:i,onDomainChange:t,domain:o=[0,1]}=s,r=ye(n),{bins:l,values:c}=r,u=Me(i),h=ge(l,u),d=f.useMemo(()=>h||(s.dataMin!==void 0&&s.dataMax!==void 0?u===je.Log&&(s.dataMin<=0||s.dataMax<=0)?de:[s.dataMin,s.dataMax]:de),[h,s.dataMin,s.dataMax,u]),[g,m]=f.useState([null,null]);return f.useEffect(()=>{m(o)},[o[0],o[1]]),g[0]===null||g[1]===null?e.jsx(e.Fragment,{}):e.jsx(Ye,{dataDomain:d,scaleType:u,value:g,onChangeMin:v=>{const a=ne([v,g[1]],d),[y]=ae(a,d,u);t(y)},onChangeMax:v=>{const a=ne([g[0],v],d),[y]=ae(a,d,u);t(y)},bins:l,values:c})}const ue=new Float64Array([]);function ps(s){var n,i,t,o;return e.jsx(vs,{histogram:{values:((n=s.histogram)==null?void 0:n.values.data)??ue,bins:((i=s.histogram)==null?void 0:i.bins.data)??ue},colorMap:s.colorMap,invertColorMap:s.invertColorMap,dataMin:((t=s.statistics)==null?void 0:t.min)??void 0,dataMax:((o=s.statistics)==null?void 0:o.max)??void 0,scaleType:s.scaleType,domain:s.scaleDomain,onDomainChange:r=>{s.autoscale&&s.setAutoscale(!1),s.setScaleDomain(r)}})}const me=[.1,1];function ys(s){const{dataDomain:n,customDomain:i,scaleType:t,disabled:o=!1}=s,{onCustomDomainChange:r}=s,l=$e(i,n),[c,u]=Qe(l,n,t),[h,d]=f.useState(l);f.useEffect(()=>{d(l)},[l]);const g=i[0]===null,m=i[1]===null;return e.jsx("div",{style:{width:"1fr",position:"relative",display:"flex",flexDirection:"column",alignItems:"center",padding:"1em"},children:e.jsx("div",{style:{display:"flex",flex:1,padding:"0 0.375rem",marginRight:"-0.375rem"},children:e.jsx(Ve,{value:h,safeVisDomain:c,dataDomain:n,scaleType:t,errors:u,isAutoMin:g,isAutoMax:m,disabled:o,onChange:v=>{d(v)},onAfterChange:(v,a)=>{r([v?h[0]:i[0],a?h[1]:i[1]])}})})})}function Ms(s){const{histogram:n,scaleType:i,onDomainChange:t,domain:o=[0,1]}=s,r=ye(n),{bins:l}=r,c=Me(i),[u,h]=f.useState([null,null]),d=ge(l,c),g=f.useMemo(()=>d||(s.dataMin!==void 0&&s.dataMax!==void 0?c===je.Log&&(s.dataMin<=0||s.dataMax<=0)?me:[s.dataMin,s.dataMax]:me),[d,s.dataMin,s.dataMax,c]);return f.useEffect(()=>{h(o)},[o[0],o[1]]),e.jsx(ys,{dataDomain:g,customDomain:u,scaleType:c,onCustomDomainChange:m=>{const v=ne(m,g),[a]=ae(v,g,c);t(a)}})}const he=new Float64Array([]);function Ds(s){var n,i,t,o;return e.jsx(Ms,{histogram:{values:((n=s.histogram)==null?void 0:n.values.data)??he,bins:((i=s.histogram)==null?void 0:i.bins.data)??he,colorMap:s.colorMap,invertColorMap:s.invertColorMap},dataMin:((t=s.statistics)==null?void 0:t.min)??void 0,dataMax:((o=s.statistics)==null?void 0:o.max)??void 0,scaleType:s.scaleType,domain:s.scaleDomain,onDomainChange:r=>{s.autoscale&&s.setAutoscale(!1),s.setScaleDomain(r)}})}function ws(s){var le;const{options:n}=s,{tomoconfig:i}=n,t=Je(),o=Pe(i??""),r=He(o),l=Xe({sampleStage:r}),c=((le=r.detector)==null?void 0:le.id)??"",h=Ie()[c],[d,g]=D("tomo/beamshaping/process",U.Proj),m=ms(),v=Ze({detector:l,sampleStage:r,profile:t.profile,normalization:t.scaleType,autoscale:t.autoscale,autoscaleMode:t.autoscaleMode,domain:t.scaleDomain,histogram:m.displayHistogram,enabled:!0,minRefreshPeriod:.5,processing:d,shared:!0}),a=v.data;ts({statistics:a==null?void 0:a.statistics,...t});const y=f.useRef(null),E=f.useRef(null),B=Ue("zoom"),{mouseMode:F,setMouseMode:ie}=B,[O,W]=D("tomo/beamshaping/roi00",null),[z,S]=D("tomo/beamshaping/roi01",null),[w,L]=D("tomo/beamshaping/roi10",null),[X,oe]=D("tomo/beamshaping/roi11",null),P=a==null?void 0:a.statistics,[Se,Ce]=f.useState(!1);function be(M){var ce;const C=M.roiMarginPencent,A=((ce=a==null?void 0:a.array)==null?void 0:ce.shape)??[0,0],[k,Z]=A,j=Math.max(Z,k)*C,G=(Z-j*3)*.5,Y=(k-j*3)*.5,b=k*.5,R=Z*.5;W({x1:b-j*.5,y1:R-j*.5,x2:b-j*.5-G,y2:R-j*.5-Y}),S({x1:b-j*.5,y1:R+j*.5,x2:b-j*.5-G,y2:R+j*.5+Y}),L({x1:b+j*.5,y1:R-j*.5,x2:b+j*.5+G,y2:R-j*.5-Y}),oe({x1:b+j*.5,y1:R+j*.5,x2:b+j*.5+G,y2:R+j*.5+Y})}const re=(a==null?void 0:a.detectorSize)??{width:1,height:1};function Re(M,C){return!C||{[U.Flatfield]:x.FlatfieldNorm,[U.Proj]:x.Proj,[U.Dark]:x.Dark,[U.Flat]:x.Flat}[M]===C?void 0:{[x.Dark]:"Dark",[x.Flat]:"Flat",[x.Proj]:"Proj",[x.Unknown]:"Unknown data",[x.FlatfieldNorm]:void 0,[x.ProjNorm]:"Only normalized proj",[x.ProjDarkNorm]:"Only normalized proj-dark",[x.ProjFlatNorm]:"Only normalized proj/flat"}[C]}const ke=Re(d,a==null?void 0:a.datakind);return e.jsx("div",{className:"plot2d-container w-100 h-100",style:{display:"grid",gridTemplateColumns:"auto min-content"},children:e.jsxs(os,{children:[e.jsxs(We,{style:{width:"100%",flex:"1 1 auto",minHeight:0,minWidth:0},plotRef:y,abscissaConfig:{visDomain:[0,re.width],label:"px"},ordinateConfig:{visDomain:[0,re.height],label:"px",flip:!0},aspect:"equal",showAxes:m.displayAxes,mouseMode:F,onMouseInteractionOverlayChanged:M=>{Ce(M!==null)},children:[e.jsx(ns,{loading:v.loading,info:ke,warning:a===null?"No data":void 0,danger:v.error}),e.jsx(Le,{zoomMode:!0,panMode:!1,disabled:Se}),O&&e.jsx(V,{geometry:O,onGeometryChanged:W,image:a==null?void 0:a.array}),z&&e.jsx(V,{geometry:z,onGeometryChanged:S,image:a==null?void 0:a.array}),w&&e.jsx(V,{geometry:w,onGeometryChanged:L,image:a==null?void 0:a.array}),X&&e.jsx(V,{geometry:X,onGeometryChanged:oe,image:a==null?void 0:a.array}),a!==null&&e.jsx(Oe,{values:a.displayArray,colorMap:t.colorMap,invertColorMap:t.invertColorMap,scaleType:t.scaleType,domain:t.scaleDomain,size:a.detectorSize,position:[a.detectorSize.width*.5,a.detectorSize.height*.5,0],scale:[1,1,1],ref:E}),e.jsx(fs,{x:0,y:0,showMean:m.displayMean,mean:(P==null?void 0:P.mean)??void 0,showEpoch:m.displayEpoch,epoch:a==null?void 0:a.epoch}),e.jsx(Ke,{guides:m.crossHair?"both":void 0,renderTooltip:(M,C)=>{var k;const A=(k=E.current)==null?void 0:k.pick(M,C);return e.jsx(xs,{px:M,py:C,pixel:A,dataKind:a==null?void 0:a.datakind})}})]}),e.jsxs(qe,{gap:1,direction:"vertical",className:"m-1 pe-2",style:{width:"18em"},children:[e.jsxs(ee,{align:"center",children:[e.jsx(Ae,{mouseModeInteraction:B}),e.jsx(J,{title:"Reset zoom (sample stage overview)",variant:"secondary",onClick:()=>{var M;(M=y==null?void 0:y.current)==null||M.actions.resetZoom()},children:e.jsx("i",{className:"fa fa-expand fa-fw fa-lg"})}),e.jsx(Ge,{}),e.jsx(us,{config:m}),e.jsx("br",{}),e.jsx(ss,{as:T,value:d,onSelect:g,detector:h,showFlatfield:!1})]}),e.jsx("h3",{children:"Colormap"}),e.jsxs(ee,{align:"center",children:[e.jsx(es,{showDisplayed:!1,variant:"secondary",isInverted:t.invertColorMap,onSelectInvertion:t.setInvertColorMap,isDisplayed:!0,onSelectDisplayed:()=>{},lut:t.colorMap,onSelectLut:t.setColorMap,norm:t.scaleType,onSelectNorm:t.setScaleType,autoscale:t.autoscale,onSelectAutoscale:t.setAutoscale,autoscaleMode:t.autoscaleMode,onSelectAutoscaleMode:t.setAutoscaleMode,profile:t.profile,onSelectProfile:t.setProfile,array:a}),e.jsx(ze,{disabled:P===void 0,...t})]}),(a==null?void 0:a.histogram)!==void 0&&e.jsx(ps,{disabled:P===void 0,statistics:a==null?void 0:a.statistics,histogram:a==null?void 0:a.histogram,...t}),e.jsx(Ds,{disabled:P===void 0,statistics:a==null?void 0:a.statistics,...t}),e.jsx("h3",{children:"Quadrants"}),e.jsxs(ee,{align:"center",children:[e.jsx(J,{variant:"secondary",onClick:()=>{be(m)},title:"Initialize 2×2 the ROIs",children:e.jsx("i",{className:"fa fa-fw fam-grid22-arrange"})}),e.jsx(js,{config:m})]}),e.jsx(cs,{geometry00:O,geometry01:z,geometry10:w,geometry11:X,image:a==null?void 0:a.array})]})]})})}function Ns(s){return e.jsx(ws,{...s})}function As(s){const{yamlNode:n,tomoconfig:i,...t}=s;Ee(n,"tomoconfig",i),Be(n,t);const o={tomoconfig:i};return e.jsx(Ns,{options:o})}export{As as default};
@@ -0,0 +1 @@
1
+ import{j as o,ag as g,aR as S,aS as h,r as v,B as M,aQ as D,ad as j,H as y}from"./index-b3c0133a.js";import{a as C,T as w,D as I,S as z,L as T}from"./UseMouseModeInteraction-51c6269c.js";import{u as b}from"./colormap-6e43299c.js";import{u as R,a as A,b as H}from"./TomoDetector-e04a5a8b.js";import{D as F}from"./DropdownDetector-5016908a.js";import{I as L,A as P}from"./AutoscaleOption-3cb99678.js";import{H as N}from"./HistogramDomainSlider-304bdab4.js";import{p as V}from"./geometry-cd448ec1.js";import{L as k}from"./Label-9d8979b3.js";import{V as q}from"./VSegment-f0d42c9a.js";import"./index-a9bb7636.js";import"./hooks-171c0765.js";import"./ColorMap-be59ad21.js";import"./Image-ee61818a.js";function O(s){const{domain:a}=s,{displayArray:i,detectorSize:e}=s.detectorArray;return o.jsx(L,{values:i,domain:a,colorMap:s.lut,invertColorMap:s.isColorMapInverted,scaleType:s.scale,position:[e.width*.5,e.height*.5,0],scale:[1,1,1],size:e})}function W(s){var d,u,p;const{tomoHardware:a,detectorArray:i}=s,e=(u=(d=i.imagePixelSize)==null?void 0:d.to("mm"))==null?void 0:u.scalar,r=a.sy?V(a.sy):null;if(r===null||e===void 0)return o.jsx(o.Fragment,{});const c=i.detectorSize.width,{sampleStage:l}=a,x=((p=l==null?void 0:l.properties.detector_center)==null?void 0:p[0])??0,t=i.detectorSize.height,n=c*.5+r/e-x,m=new g(n,t*.75),f=t/50;return o.jsxs(o.Fragment,{children:[o.jsx(q,{x:n,y1:t,y2:t*.75,color:"red",gapColor:"white",dashSize:f,gapSize:f,lineWidth:2}),o.jsx(k,{datapos:[m.x,m.y],color:"#FF0000",text:"Theorical rotation axis"})]})}D("daiquiri.components.tomo.detector.Default");function Y(s){const{options:a}=s,{tomoconfig:i}=a,e=R(),r=S(i??""),c=h(r),l=A({sampleStage:c}),t=H({detector:l,sampleStage:c,profile:e.profile,normalization:e.scaleType,autoscale:e.autoscale,autoscaleMode:e.autoscaleMode,domain:e.scaleDomain,enabled:!0,minRefreshPeriod:.5}).data,n=v.useRef(null),m=C("zoom"),{mouseMode:f}=m,d=(t==null?void 0:t.detectorSize)??{width:0,height:0},u=t==null?void 0:t.statistics;return b({statistics:t==null?void 0:t.statistics,...e}),o.jsxs("div",{className:"plot2d-container w-100 h-100",style:{flex:"1 1 0%",display:"flex",flexDirection:"column"},children:[o.jsxs(w,{align:"center",children:[o.jsx(I,{mouseModeInteraction:m}),o.jsx(M,{title:"Reset zoom (sample stage overview)",variant:"secondary",onClick:()=>{var p;(p=n==null?void 0:n.current)==null||p.actions.resetZoom()},children:o.jsx("i",{className:"fa fa-expand fa-fw fa-lg"})}),o.jsx(z,{}),o.jsx(F,{showDisplayed:!1,variant:"secondary",isInverted:e.invertColorMap,onSelectInvertion:e.setInvertColorMap,isDisplayed:!0,onSelectDisplayed:()=>{},lut:e.colorMap,onSelectLut:e.setColorMap,norm:e.scaleType,onSelectNorm:e.setScaleType,autoscale:e.autoscale,onSelectAutoscale:e.setAutoscale,autoscaleMode:e.autoscaleMode,onSelectAutoscaleMode:e.setAutoscaleMode,profile:e.profile,onSelectProfile:e.setProfile,array:t}),o.jsx(P,{disabled:u===void 0,...e}),o.jsx(N,{disabled:u===void 0,statistics:t==null?void 0:t.statistics,...e})]}),o.jsx("div",{style:{flex:"1 1 auto",display:"flex",margin:0,minHeight:0},children:o.jsx(T,{plotRef:n,abscissaConfig:{visDomain:[0,d.width],label:"px"},ordinateConfig:{visDomain:[0,d.height],label:"px",flip:!0},mouseMode:f,aspect:"equal",children:t&&o.jsxs(o.Fragment,{children:[o.jsx(O,{detectorArray:t,lut:e.colorMap,isColorMapInverted:e.invertColorMap,scale:e.scaleType,domain:e.scaleDomain}),o.jsx(W,{tomoHardware:c,detectorArray:t})]})})})]})}function B(s){return o.jsx(Y,{...s})}function ae(s){const{yamlNode:a,tomoconfig:i,...e}=s;j(a,"tomoconfig",i),y(a,e);const r={tomoconfig:i};return o.jsx(B,{options:r})}export{ae as default};
@@ -0,0 +1 @@
1
+ import{u as l,b as h,a as f}from"./ColorMap-be59ad21.js";import{r,bY as g,aQ as v,aT as D}from"./index-b3c0133a.js";import{A as u}from"./colormap-6e43299c.js";import{a as b}from"./index-a9bb7636.js";function T(e,i,o,a=!1){const t=r.useRef(),n=r.useRef();return g(()=>{t.current&&clearTimeout(t.current)}),r.useMemo(()=>{const s=(c,m)=>{n.current=void 0,e.apply(c,m),t.current=setTimeout(()=>{t.current=void 0,!a&&n.current&&(s(n.current.this,n.current.args),n.current=void 0)},o)},d=function(...c){if(t.current){n.current={args:c,this:this};return}s(this,c)};return Object.defineProperties(d,{length:{value:e.length},name:{value:`${e.name||"anonymous"}__throttled__${o}`}}),d},[o,a,...i])}function R(){return{...l({name:"tomo/defaultcolormap"})}}v("daiquiri.components.tomo.utils.TomoDetector");function x(e){const i=D();return r.useMemo(()=>{function o(){var t;if(e.sampleStage){const{detector:n}=e.sampleStage;return n?n.id:""}return((t=e.sampleStageRefs)==null?void 0:t.detector)??""}const a=o();return i[a]},[e.sampleStage,i])}function z(e){const[i,o]=h(),a=T(o,[e.minRefreshPeriod,o],e.minRefreshPeriod*1e3,!0);r.useEffect(()=>{e.profile!=="u8"&&e.enabled&&e.detector&&a({detector:e.detector,lut:"Cividis",autoscale:u.StdDev3,normalization:b.Linear,process:e.processing??f.Flatfield,profiles:[e.profile],histogram:e.histogram,shared:e.shared})},[e.detector,a,e.enabled,e.profile,e.processing,e.histogram,e.shared]);function t(){return e.autoscale&&e.autoscaleMode!==u.None?{autoscale:e.autoscaleMode}:{vmin:e.domain[0],vmax:e.domain[1],autoscale:u.None}}return r.useEffect(()=>{e.profile==="u8"&&e.enabled&&e.detector&&a({detector:e.detector,lut:"Cividis",normalization:e.normalization,process:e.processing??f.Flatfield,profiles:[e.profile],histogram:e.histogram,...t(),shared:e.shared})},[e.detector,a,e.enabled,e.profile,e.processing,e.autoscale,e.autoscaleMode,e.normalization,e.domain[0],e.domain[1],e.histogram,e.shared]),i}export{x as a,z as b,R as u};
@@ -0,0 +1,64 @@
1
+ import{b as ue,j as e,aH as W,as as S,B as H,i as xe,R as C,C as v,u as I,aU as fe,aV as pe,aW as he,r as z,aX as je,aQ as E,ak as k,ag as ve,aT as ye,aR as ge,aS as we,aL as T,ad as Se,aF as ze,H as De}from"./index-b3c0133a.js";import{O as Ne}from"./OptionsProcess-da629bfb.js";import{a as Me,T as be,D as Ce,S as _,L as J}from"./UseMouseModeInteraction-51c6269c.js";import{g as P,p as A,a as R,f as Ie}from"./geometry-cd448ec1.js";import{a as Pe,T as N}from"./ColorMap-be59ad21.js";import{u as Fe}from"./colormap-6e43299c.js";import{O as ke,w as ee}from"./index-a9bb7636.js";import{u as Ve,b as Te}from"./TomoDetector-e04a5a8b.js";import{D as Le}from"./DropdownDetector-5016908a.js";import{S as se}from"./SceneScale-e2a42af2.js";import{P as He}from"./SelectionPoint-a2cb4dfc.js";import{L as te}from"./LoadingMessage-03b4fa4f.js";import{I as Oe,A as Ye}from"./AutoscaleOption-3cb99678.js";import{H as We}from"./HistogramDomainSlider-304bdab4.js";import{R as Re,a as oe}from"./RulerButton-a95a6035.js";import{r as L}from"./TomoService-e9741d6a.js";import{c as Ee,L as ae}from"./Label-9d8979b3.js";import{S as Xe}from"./ScreenScale-b2417934.js";import{C as _e}from"./CrossMarker-71cd11cf.js";import{C as Ae}from"./Cross-d5df0df3.js";import{V as Ue}from"./VSegment-f0d42c9a.js";import"./hooks-171c0765.js";import"./QtyHelper-8429914f.js";import"./Image-ee61818a.js";import"./Anchor-0b4a3d33.js";import"./DraggableRect-25d91c7d.js";import"./types-c366a377.js";import"./HSegment-8d2c001e.js";function $e(t){const{mouseMode:a,setOrResetMouseMode:n}=t,s=ue();function i(x,c){return x?x.alias??x.name:c}function l(x){if(!s)return"You must have the control to the session to move motors";if(!x)return"This motor is not available";if(!x.online)return"This motor is not online";const{state:c}=x.properties;if(!c.includes("READY"))return`This motor is not ready (found ${x.properties.state})`}const r=l(t.sy),o=l(t.sz),m=l(t.sampy),d=i(t.sy,"sy"),u=i(t.sz,"sz"),f=i(t.sampy,"sampy");return e.jsxs(W,{as:S,className:t.className,children:[t.sampy!==null&&e.jsxs(H,{variant:a==="sampy"?"danger":"secondary",onClick:()=>{n==null||n("sampy")},disabled:m!==void 0,title:m,children:[e.jsx("i",{className:"fa fam-arrow-h-over-rot"})," ",f]}),e.jsxs(H,{variant:a==="sy"?"danger":"secondary",onClick:()=>{n==null||n("sy")},disabled:r!==void 0,title:r,children:[e.jsx("i",{className:"fa fam-arrow-h-under-rot"})," ",d]}),e.jsxs(H,{variant:a==="sz"?"danger":"secondary",onClick:()=>{n==null||n("sz")},disabled:o!==void 0,title:o,children:[e.jsx("i",{className:"fa fa-arrows-v"})," ",u]})]})}function Be(t,a,n){const s=re(t);if(s===null)return null;const{y:i,z:l,fov:r}=s;if(r===null)return null;function o(){if(a===null||n.follow==="motors")return[i,l];const f=le(t,a);return f===null?[0,0]:[f.y,f.z]}const[m,d]=o();function u(){return t.sampy===null?`${P(t.sy,"sy")} (mm)`:`${P(t.sy,"sy")} + ${P(t.sampy,"sampy")} (mm)`}return{detectorCenter:[i,l],minDetectorPos:[i-r[0]*.5,l-r[1]*.5],maxDetectorPos:[i+r[0]*.5,l+r[1]*.5],viewCenter:[m-r[0]*.5,d-r[1]*.5*n.fieldOfView],minViewPos:[m-r[0]*.5,d-r[1]*.5*n.fieldOfView],maxViewPos:[m+r[0]*.5,d+r[1]*.5*n.fieldOfView],labelY:u(),labelZ:`${P(t.sz,"sz")} (mm)`}}function re(t){const{sy:a,sz:n,sampy:s,tomoDetector:i,detector:l}=t;if(a===null||n===null)return null;const r=A(n),o=R(s)??0,m=A(a),d=Ie(i,l);return{y:m+o,z:r,fov:d}}function le(t,a){const{imagePixelSize:n,sampyPosition:s,syPosition:i,szPosition:l,detectorCenterY:r,detectorCenterZ:o}=a;if(n===null||n.units()==="pixel"||i===null||l===null)return null;const{sampleStage:m}=t,d=(m==null?void 0:m.properties.detector_center)??[0,0],u=d[0]??0,f=d[1]??0,x=(r==null?void 0:r.to("mm").scalar)??0,c=(o==null?void 0:o.to("mm").scalar)??0,O=n.to("mm").scalar,M=i.to("mm").scalar,F=l.to("mm").scalar,b=s?s.to("mm").scalar:0,y=M+b+(u-x),U=F+(f-c);return{y,z:U,px:O}}function qe(t,a){return t===a?"primary":"secondary"}function h(t){return e.jsx(H,{variant:qe(t.var,t.value),onClick:()=>{t.setter(t.value)},className:"text-nowrap",size:"sm",children:t.children})}function Ge(t){const{as:a=void 0,variant:n="secondary",config:s}=t;return e.jsxs(W,{as:a,children:[e.jsx(W.Toggle,{id:"dropdown-basic",variant:n,className:"d-flex align-items-center",children:e.jsx("i",{className:"fa fa-sliders fa-fw fa-lg"})}),e.jsx(W.Menu,{className:"dropdown-menu-center",children:e.jsx("div",{className:"ms-1 me-1",style:{minWidth:"300px"},children:e.jsxs(xe,{children:[e.jsxs(C,{children:[e.jsx(v,{className:"my-auto",children:"Display axes"}),e.jsx(v,{xs:7,children:e.jsxs(S,{children:[e.jsx(h,{var:s.displayAxes,value:!0,setter:s.setDisplayAxes,children:"Yes"}),e.jsx(h,{var:s.displayAxes,value:!1,setter:s.setDisplayAxes,children:"No"})]})})]}),e.jsxs(C,{className:"mt-1",children:[e.jsx(v,{className:"my-auto",children:"Follow"}),e.jsx(v,{xs:7,children:e.jsxs(S,{children:[e.jsx(h,{var:s.follow,value:"motors",setter:s.setFollow,children:"Motors"}),e.jsx(h,{var:s.follow,value:"last-image",setter:s.setFollow,children:"Last image"})]})})]}),e.jsxs(C,{className:"mt-1",children:[e.jsx(v,{className:"my-auto",children:"Field of view"}),e.jsx(v,{xs:7,children:e.jsxs(S,{children:[e.jsx(h,{var:s.fieldOfView,value:1,setter:s.setFieldOfView,children:"×1"}),e.jsx(h,{var:s.fieldOfView,value:1.5,setter:s.setFieldOfView,children:"×1.5"}),e.jsx(h,{var:s.fieldOfView,value:2,setter:s.setFieldOfView,children:"×2"}),e.jsx(h,{var:s.fieldOfView,value:3,setter:s.setFieldOfView,children:"×3"})]})})]}),e.jsxs(C,{className:"mt-1",children:[e.jsx(v,{className:"my-auto",children:"Crosshair"}),e.jsx(v,{xs:7,children:e.jsxs(S,{children:[e.jsx(h,{var:s.crossHair,value:!0,setter:s.setCrossHair,children:"Yes"}),e.jsx(h,{var:s.crossHair,value:!1,setter:s.setCrossHair,children:"No"})]})})]}),e.jsxs(C,{className:"mt-1",children:[e.jsx(v,{className:"my-auto",children:"Mean level"}),e.jsx(v,{xs:7,children:e.jsxs(S,{children:[e.jsx(h,{var:s.displayMean,value:!0,setter:s.setDisplayMean,children:"Show"}),e.jsx(h,{var:s.displayMean,value:!1,setter:s.setDisplayMean,children:"Hide"})]})})]}),e.jsxs(C,{className:"mt-1",children:[e.jsx(v,{className:"my-auto",children:"Timestamp"}),e.jsx(v,{xs:7,children:e.jsxs(S,{children:[e.jsx(h,{var:s.displayEpoch,value:!0,setter:s.setDisplayEpoch,children:"Show"}),e.jsx(h,{var:s.displayEpoch,value:!1,setter:s.setDisplayEpoch,children:"Hide"})]})})]}),e.jsxs(C,{className:"mt-1",children:[e.jsx(v,{className:"my-auto",children:"Histogram"}),e.jsx(v,{xs:7,children:e.jsxs(S,{children:[e.jsx(h,{var:s.displayHistogram,value:!0,setter:s.setDisplayHistogram,children:"Show"}),e.jsx(h,{var:s.displayHistogram,value:!1,setter:s.setDisplayHistogram,children:"Hide"})]})})]})]})})})]})}function Ze(){const[t,a]=I("tomo/detectorview/follow","last-image"),[n,s]=I("tomo/detectorview/axes",!0),[i,l]=I("tomo/detectorview/field-of-view",1),[r,o]=I("tomo/detectorview/crosshair",!1),[m,d]=I("tomo/detectorview/mean",!0),[u,f]=I("tomo/detectorview/epoch",!1),[x,c]=I("tomo/detectorview/histogram",!1);return{follow:t,setFollow:a,displayAxes:n,setDisplayAxes:s,fieldOfView:i,setFieldOfView:l,crossHair:r,setCrossHair:o,displayMean:m,setDisplayMean:d,displayEpoch:u,setDisplayEpoch:f,displayHistogram:x,setDisplayHistogram:c}}class Ke extends pe{constructor(){super({uniforms:{color:{value:new he},lineWidth:{value:0},sizeXInScreen:{value:0},sizeYInScreen:{value:0},inner:{value:0}},vertexShader:`
2
+ out vec2 pixelCoord;
3
+
4
+ void main() {
5
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
6
+ pixelCoord = vec2(position.x, position.y);
7
+ }
8
+ `,fragmentShader:`
9
+ uniform vec4 color;
10
+ uniform float lineWidth;
11
+ uniform float sizeXInScreen; // signed size
12
+ uniform float sizeYInScreen; // signed size
13
+ uniform int inner; // 0 or 1
14
+
15
+ in vec2 pixelCoord;
16
+
17
+ /**
18
+ * Exact signed distance function to compute an
19
+ * orthogonal rectangle.
20
+ *
21
+ * @param pos: Pixel position
22
+ * @param center: Center of the rectangle
23
+ * @param size: Size of the rectangle
24
+ */
25
+ float sdf_rect(vec2 pos, vec2 center, vec2 size) {
26
+ vec2 d = abs(pos - center) - size * 0.5;
27
+ return length(max(d, 0.0)) + min(max(d.x, d.y), 0.0);
28
+ }
29
+
30
+ void main() {
31
+ float is_inner = float(inner);
32
+ float d1 = sdf_rect(
33
+ pixelCoord,
34
+ vec2(
35
+ (sizeXInScreen - (1.0 - is_inner) * lineWidth * sign(sizeXInScreen)) * 0.5,
36
+ is_inner * lineWidth * sign(sizeYInScreen) * 0.5
37
+ ),
38
+ vec2(abs(sizeXInScreen), lineWidth)
39
+ );
40
+ float d2 = sdf_rect(
41
+ pixelCoord,
42
+ vec2(
43
+ is_inner * lineWidth * sign(sizeXInScreen) * 0.5,
44
+ (sizeYInScreen - (1.0 - is_inner) * lineWidth * sign(sizeYInScreen)) * 0.5
45
+ ),
46
+ vec2(lineWidth, abs(sizeYInScreen))
47
+ );
48
+ float d = min(d1, d2);
49
+
50
+ if (d > 0.2) {
51
+ discard;
52
+ }
53
+
54
+ float alpha;
55
+ if (lineWidth >= 1.0) {
56
+ alpha = smoothstep(0.2, 0.0, d);
57
+ } else {
58
+ // simulate line thiner than 1px with alpha
59
+ alpha = lineWidth;
60
+ }
61
+
62
+ gl_FragColor = vec4(color.r, color.g, color.b, alpha * color.a);
63
+ }
64
+ `})}}fe({CornerMarkerMaterial:Ke});function Y(t){const{x:a,y:n,color:s="black",opacity:i,sizeXInScreen:l,sizeYInScreen:r,lineWidth:o=1,inner:m=!1,zIndex:d=0}=t,u=z.useRef(null);return z.useEffect(()=>{const f=Ee(s,i);if(u.current){const x=u.current.uniforms;x.color.value=f,x.lineWidth.value=o,x.sizeXInScreen.value=l,x.sizeYInScreen.value=r,x.inner.value=m?1:0,je()}},[s,i,o,l,r,m]),e.jsx("group",{position:[a,n,d],children:e.jsx(Xe,{screenDirection:!1,children:e.jsxs("mesh",{children:[e.jsx("ambientLight",{}),e.jsx("planeGeometry",{attach:"geometry",args:[Math.abs(l)*2+o,Math.abs(r)*2+o,1,1]}),e.jsx("cornerMarkerMaterial",{attach:"material",transparent:!0,ref:u})]})})})}const Qe=E("daiquiri.components.tomo.detectorview.ActualDetectorLocation");function Je(t){const{x:a,y:n,fov:s}=t,i=s[0]*.5,l=s[1]*.5,r=40,o=40;return e.jsxs(e.Fragment,{children:[e.jsx(Y,{x:a+i,y:n+l,sizeXInScreen:-r,sizeYInScreen:-o,color:k.danger,lineWidth:4,inner:!0}),e.jsx(Y,{x:a-i,y:n-l,sizeXInScreen:r,sizeYInScreen:o,color:k.danger,lineWidth:4,inner:!0}),e.jsx(Y,{x:a-i,y:n+l,sizeXInScreen:r,sizeYInScreen:-o,color:k.danger,lineWidth:4,inner:!0}),e.jsx(Y,{x:a+i,y:n-l,sizeXInScreen:-r,sizeYInScreen:o,color:k.danger,lineWidth:4,inner:!0})]})}function es(t){const{tomoHardware:a}=t,{detector:n}=a,s=re(a);if(s===null)return Qe("Skipped: one of sy, sz is missing."),e.jsx(e.Fragment,{});const{y:i,z:l,fov:r}=s;return e.jsxs(e.Fragment,{children:[e.jsx(_e,{x:i,y:l,color:k.danger,sizeInScreen:40,lineWidth:3,zIndex:.5}),r!==null&&e.jsxs(e.Fragment,{children:[e.jsx(ae,{datapos:[i-r[0]*.5,l-r[1]*.5],color:k.danger,text:(n==null?void 0:n.name)??"Detector",anchor:"top-right"}),e.jsx(Je,{x:i,y:l,fov:r})]})]})}E("daiquiri.components.tomo.detectorview.DetectorPositionMesh");function ss(t){const{x:a,y:n,showMean:s,mean:i,showEpoch:l,epoch:r}=t,o=z.useMemo(()=>{if(r!==void 0)return new Date(r*1e3)},[r]);if(!l&&(!s||i===void 0))return e.jsx(e.Fragment,{});function m(d){return d===void 0?"Undefined":`${d.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:1})}`}return e.jsxs(ke,{x:a,y:n,children:[s&&i!==void 0&&e.jsx("div",{className:"ms-2 mt-2",title:"Mean grey level",children:e.jsxs("div",{className:"bg-dark text-light p-1 rounded font-tabular-nums",children:[e.jsx("i",{className:"fa-solid fa-circle-half-stroke fa-fw fa-lg"})," ",i.toFixed(2)]})}),l&&e.jsx("div",{className:"ms-2 mt-2",title:`Timestamp (${(o==null?void 0:o.toUTCString())??"undefined"})`,children:e.jsxs("div",{className:"bg-dark text-light p-1 rounded font-tabular-nums",children:[e.jsx("i",{className:"fa-solid fa-clock fa-fw fa-lg"})," ",m(o)]})})]})}function ne(t){const{config:a,detectorArray:n}=t,{displayArray:s,statistics:i,detectorSize:l,epoch:r}=n,o=le(t.tomoHardware,n);if(o===null)return null;const{y:m,z:d,px:u}=o;return e.jsxs(e.Fragment,{children:[e.jsx(Oe,{ref:t.imageRef,values:s,domain:t.domain,colorMap:t.lut,invertColorMap:t.isColorMapInverted,scaleType:t.scale,position:[m,d,0],scale:[-u,u,u],size:l}),e.jsx(ss,{x:m+l.width*u*.5,y:d-l.height*u*.5,showMean:a.displayMean,mean:(i==null?void 0:i.mean)??void 0,showEpoch:a.displayEpoch,epoch:r}),e.jsx(Ae,{centerX:m,centerY:d,width:l.width*u,height:l.height*u,color:"white",gapColor:"black",dashSize:5,gapSize:5,lineWidth:1})]})}function ie(t){function a(d,u){return Math.round(d)===d?d.toFixed(0):d.toFixed(u)}const{sampleStage:n}=t,s=R(n.sy);R(n.sz);const i=R(n.sampy),l=P(n.sy,"sy"),r=P(n.sampy,"sampy"),o=P(n.sz,"sz"),m=2;return e.jsx("table",{children:e.jsxs("tbody",{children:[i===null&&s!==null&&e.jsxs("tr",{className:"flex-nowrap text-nowrap",children:[e.jsx("td",{children:l}),e.jsx("td",{className:"text-end",children:t.px.toFixed(m)}),e.jsx("td",{className:"text-start",children:"mm"})]}),i!==null&&s!==null&&e.jsxs("tr",{className:"flex-nowrap text-nowrap",children:[e.jsx("td",{children:l}),e.jsx("td",{className:"text-end",children:(s+i-t.px).toFixed(m)}),e.jsx("td",{className:"text-start",children:"mm"})]}),i!==null&&s!==null&&e.jsxs("tr",{className:"flex-nowrap text-nowrap",children:[e.jsx("td",{children:r}),e.jsx("td",{className:"text-end",children:(t.px-s).toFixed(m)}),e.jsx("td",{className:"text-start",children:"mm"})]}),e.jsxs("tr",{className:"flex-nowrap text-nowrap",children:[e.jsx("td",{style:{minWidth:"7em"},children:o}),e.jsx("td",{style:{minWidth:"4em"},className:"text-end",children:t.py.toFixed(m)}),e.jsx("td",{className:"text-start",children:"mm"})]}),t.pixel!==void 0&&e.jsxs("tr",{className:"flex-nowrap text-nowrap",children:[e.jsx("td",{children:"pixel"}),e.jsx("td",{className:"text-end",children:a(t.pixel,m)}),e.jsx("td",{className:"text-start"})]})]})})}E("daiquiri.components.tomo.detectorview.ActualRotationAxisLocation");function ts(t){var u,f;const{tomoHardware:a,sampleStageGeometry:n}=t;if(a.sy===null)return e.jsx(e.Fragment,{});const s=((f=(u=a.sampleStage)==null?void 0:u.properties.detector_center)==null?void 0:f[0])??0,i=n.detectorCenter[0]+A(a.sy)-s,l=n.maxDetectorPos[1],r=n.maxDetectorPos[1]-n.minDetectorPos[1],o=l-r*.1,m=new ve(i,o),d=10;return e.jsxs(e.Fragment,{children:[e.jsx(Ue,{x:i,y1:l,y2:o,color:"red",gapColor:"white",dashSize:d,gapSize:d,lineWidth:2,zIndex:1.5}),e.jsx(ae,{datapos:[m.x,m.y],color:"#FF0000",text:"Theorical rotation axis"})]})}function os(t,a){z.useEffect(()=>{function n(){a()}const s=t.current;return s===null?()=>{}:(s.addEventListener("pointerleave",n),()=>{s.removeEventListener("pointerleave",n)})},[t.current])}E("daiquiri.components.tomo.detectorview.Default");function ns(t,a){return t??a}function is(t){var G,Z,K,Q;const{options:a}=t,n=ye(),s=ge(a.tomoconfig??""),i=we(s),l=((G=i.detector)==null?void 0:G.id)??"",r=n[l],o=Ve(),m=ns(a.moveenabled,!0),d=Ze(),[u,f]=z.useState(Pe.Flatfield),x=Te({detector:r,sampleStage:i,profile:o.profile,normalization:o.scaleType,autoscale:o.autoscale,autoscaleMode:o.autoscaleMode,domain:o.scaleDomain,histogram:d.displayHistogram,enabled:!0,minRefreshPeriod:.5,processing:u}),c=x.data;Fe({statistics:c==null?void 0:c.statistics,...o});const O=z.useRef(null),M=z.useRef(null),F=z.useRef(null),b=Me("zoom"),{mouseMode:y,setMouseMode:U}=b,w=Be(i,c,d);function $(p){if(!i)return null;const j=i[p]||null;if(!j)return null;const D=j.properties.position;return D===null?null:new T(D,j.properties.unit)}const X=$("sampy"),V=$("sy");os(O,()=>{b.resetMouseMode()});const ce=z.useCallback(p=>{const j=p.dataPt.x,D=p.dataPt.y;switch(y){case"pan":break;case"zoom":break;case"sampy":if(V!==null){const g=new T(j,"mm").sub(V);L({sampy:g})}else console.error("sy axis is not defined");break;case"sy":if(V!==null)if(X!==null){const g=V.add(X).sub(new T(j,"mm"));L({sy:g})}else{const g=new T(j,"mm");L({sy:g})}else console.error("sy axis is not defined");break;case"sz":L({sz:new T(D,"mm")});break;default:console.error(`Unexpected ${y}`)}},[y,X,V,L,c]),B=c==null?void 0:c.statistics,de=!(c!=null&&c.imagePixelSize)||((Z=c==null?void 0:c.imagePixelSize)==null?void 0:Z.units())==="pixel";function me(p){return p?{[N.Dark]:"Dark",[N.Flat]:"Flat",[N.Proj]:"Proj",[N.Unknown]:"Unknown data",[N.FlatfieldNorm]:void 0,[N.ProjNorm]:"Only normalized proj",[N.ProjDarkNorm]:"Only normalized proj-dark",[N.ProjFlatNorm]:"Only normalized proj/flat"}[p]:void 0}const q=me(c==null?void 0:c.datakind);return e.jsxs("div",{ref:O,className:"plot2d-container w-100 h-100",style:{flex:"1 1 0%",display:"flex",flexDirection:"column"},children:[e.jsxs(be,{align:"center",children:[e.jsx(Ce,{mouseModeInteraction:b}),e.jsx(H,{title:"Reset zoom (sample stage overview)",variant:"secondary",onClick:()=>{var p;(p=M==null?void 0:M.current)==null||p.actions.resetZoom()},children:e.jsx("i",{className:"fa fa-expand fa-fw fa-lg"})}),e.jsx(_,{}),e.jsx(Re,{mouseModeInteraction:b}),m&&e.jsx($e,{mouseMode:y,setOrResetMouseMode:b.setOrResetMouseMode,sy:i.sy,sz:i.sz,sampy:i.sampy}),e.jsx(_,{}),e.jsx(Le,{showDisplayed:!1,variant:"secondary",isInverted:o.invertColorMap,onSelectInvertion:o.setInvertColorMap,isDisplayed:!0,onSelectDisplayed:()=>{},lut:o.colorMap,onSelectLut:o.setColorMap,norm:o.scaleType,onSelectNorm:o.setScaleType,autoscale:o.autoscale,onSelectAutoscale:o.setAutoscale,autoscaleMode:o.autoscaleMode,onSelectAutoscaleMode:o.setAutoscaleMode,profile:o.profile,onSelectProfile:o.setProfile,array:c}),e.jsx(Ye,{disabled:B===void 0,...o}),e.jsx(We,{disabled:B===void 0,statistics:c==null?void 0:c.statistics,histogram:c==null?void 0:c.histogram,...o}),e.jsx(Ne,{as:S,value:u,onSelect:f,detector:r}),e.jsx(_,{}),e.jsx(Ge,{config:d})]}),e.jsxs("div",{style:{flex:"1 1 auto",display:"flex",margin:0,minHeight:0},children:[w!==null&&e.jsxs(J,{plotRef:M,abscissaConfig:{visDomain:[w.minViewPos[0],w.maxViewPos[0]],label:w.labelY,flip:!0},ordinateConfig:{visDomain:[w.minViewPos[1],w.maxViewPos[1]],label:w.labelZ,flip:!0},showAxes:d.displayAxes,mouseMode:y,aspect:"equal",children:[e.jsx(te,{loading:x.loading,info:q,warning:c===null?"No data":void 0,danger:x.error}),e.jsx(oe,{mouseMode:y,plotUnit:"mm"}),c&&e.jsx(ne,{tomoHardware:i,config:d,detectorArray:c,lut:o.colorMap,isColorMapInverted:o.invertColorMap,scale:o.scaleType,domain:o.scaleDomain,imageRef:F}),e.jsx(ts,{tomoHardware:i,sampleStageGeometry:w}),e.jsx(es,{tomoHardware:i}),e.jsx(ee,{guides:d.crossHair?"both":void 0,renderTooltip:(p,j)=>{var g;const D=(g=F.current)==null?void 0:g.pick(p,j);return e.jsx(ie,{sampleStage:i,px:p,py:j,pixel:D})}}),(y==="sz"||y==="sampy"||y==="sy")&&e.jsx(He,{onClick:ce}),e.jsx(se,{unit:"mm"})]}),w===null&&e.jsxs(J,{plotRef:M,abscissaConfig:{visDomain:[0,((K=c==null?void 0:c.detectorSize)==null?void 0:K.width)??1],label:"width (px)",flip:!0},ordinateConfig:{visDomain:[0,((Q=c==null?void 0:c.detectorSize)==null?void 0:Q.height)??1],label:"height (px)",flip:!0},showAxes:d.displayAxes,mouseMode:y,children:[e.jsx(te,{loading:x.loading,info:q,warning:c===null?"No data":de?"No sample pixel size defined":void 0,danger:x.error}),c&&e.jsx(e.Fragment,{children:e.jsx(ne,{tomoHardware:i,config:d,detectorArray:c,lut:o.colorMap,isColorMapInverted:o.invertColorMap,scale:o.scaleType,domain:o.scaleDomain,imageRef:F})}),e.jsx(ee,{guides:d.crossHair?"both":void 0,renderTooltip:(p,j)=>{var g;const D=(g=F.current)==null?void 0:g.pick(p,j);return e.jsx(ie,{sampleStage:i,px:p,py:j,pixel:D})}}),e.jsx(se,{unit:"px"}),e.jsx(oe,{mouseMode:y,plotUnit:"px"})]})]})]})}function as(t){return e.jsx(is,{...t})}function Ls(t){const{yamlNode:a,tomoconfig:n,moveenabled:s,...i}=t;Se(a,"tomoconfig",n),ze(a,"moveenabled",s),De(a,i);const l={tomoconfig:n,moveenabled:s};return e.jsx(as,{options:l})}export{Ls as default};
@@ -0,0 +1 @@
1
+ import{j as e,aY as K,aZ as Q,r as h,F as B,D as W,I as Z,B as w,l as U,a_ as J,aR as X,aO as V,a$ as ee,b as te,b0 as se,b1 as ne,A as L,R as E,C as x,b2 as P,i as re,aQ as ae,b3 as oe,b4 as ie,aL as le,ad as ce,aF as de,H as ue}from"./index-b3c0133a.js";import{g as me}from"./geometry-cd448ec1.js";function pe(s){const{hardware:t}=s,n=t.online?t.properties.state:"OFFLINE",r={READY:"success",MOVING:"transiant",STABILIZING:"transiant",INVALID:"danger",INVALID_DETECTOR_BINNING_CHANGED:"danger",INVALID_DETECTOR_DISTANCE_CHANGED:"danger",INVALID_DETECTOR_CHANGED:"danger"},l=r[n]||r.UNKNOWN;return e.jsx(K,{state:n,minWidth:6,variant:l})}function xe(s){return s.type==="tomoholo"}function fe(s){const t=Q(s);return t===null||!xe(t)?null:t}function he(){const[s,t]=h.useState(!1),n=h.useRef(null),r=()=>t(!0),l=()=>t(!1);return h.useEffect(()=>{const a=n.current;return a?(a.addEventListener("mouseover",r),a.addEventListener("mouseout",l),()=>{a.removeEventListener("mouseover",r),a.removeEventListener("mouseout",l)}):()=>{}},[n.current]),[n,s]}function G(s){const{coef:t=1}=s,n=h.useRef(null),[r,l]=h.useState(!1),[a,u]=h.useState(!1);function m(i){if(i===null)return"";const c=i*t;return s.precision!==void 0?c.toFixed(s.precision):c.toString()}h.useEffect(()=>{n.current&&(n.current.value=m(s.value),l(!1))},[s.value,s.precision]);function o(i){const c=m(i);n!=null&&n.current&&(n.current.value=c)}function d(i){function c(){try{return Number.parseFloat(i.target.value)/t}catch{return null}}switch(i.key){case"Enter":{l(!1);const f=c(),g=s.onValidate(f);g&&g.catch(()=>{u(!0),setTimeout(()=>{o(s.value),u(!1)},2e3)}),i.preventDefault(),i.stopPropagation();break}case"Esc":case"Escape":r&&(u(!1),l(!1),o(s.value)),i.target.blur(),i.preventDefault(),i.stopPropagation();break}}function v(i){var c;l(i.target.value!==((c=s.value)==null?void 0:c.toString()))}return e.jsx(B.Control,{className:W({"form-control-edited":r,"form-control-error":a}),type:"number",ref:n,onChange:v,onKeyDown:d,disabled:s.readOnly,step:s.step})}function ge(s){const{value:t,onValueChanged:n,disabled:r=!1}=s;return e.jsxs(Z,{children:[e.jsx(B.Control,{value:`${t??""}`,disabled:r,readOnly:!0}),e.jsx(w,{variant:t===2?"primary":"secondary",onClick:()=>{n(2)},disabled:r,children:"2"}),e.jsx(w,{variant:t===3?"primary":"secondary",onClick:()=>{n(3)},disabled:r,children:"3"}),e.jsx(w,{variant:t===4?"primary":"secondary",onClick:()=>{n(4)},disabled:r,children:"4"}),e.jsx(w,{variant:t===5?"primary":"secondary",onClick:()=>{n(5)},disabled:r,children:"5"})]})}function je(s){const{style:t,position:n,distances:r,className:l,thumbClassName:a,thumbStyle:u={},thumbTitle:m}=s,o=h.useMemo(()=>{const i=[];if(r.length>1){const c=r[0].position,f=r[1].position;i.push(c-(f-c)*.5)}for(const c of r)i.push(c.position);if(r.length>1){const c=r[r.length-2].position,f=r[r.length-1].position;i.push(f+(f-c)*.5)}return i},[r]),d=h.useMemo(()=>{if(n===null)return null;let i=o.length;for(const[b,C]of o.entries())if(n<C){i=b-1;break}if(i<=-1)return .5;if(i>=o.length)return o.length+.5;const c=o[i],f=o[i+1],g=(n-c)/(f-c),T=i===0?-.5:i,_=i===o.length-2?o.length-.5:i+1;return T*(1-g)+_*g},[o,n]);if(d===null)return e.jsx(e.Fragment,{});const v=U.clamp((d-.5)/(o.length-2),0,1)*100;return e.jsx("div",{className:`multi-linear-range ${l}`,style:t,children:e.jsx("i",{className:`${a}`,style:{...u,left:`${v}%`},title:m})})}ae("daiquiri.components.tomo.TomoDetector");function z(s,t,n,r){return h.useMemo(()=>{function l(m){return m==="um"?"μm":m}function a(m){return r<=0?m.toFixed(r):m.toFixed(r).replace(/\.?0+$/,"")}if(s===null)return"∅";if(t===n)return`${a(s)} ${l(n)}`;const u=le(s,t);return`${a(u.to(n).scalar)} ${l(n)}`},[s,t,n,r])}function ve(s){return s==null?null:s.replace("hardware:","")}function Ne(s){var O,A,S,k,M;const{distance:t,tomoDetector:n,moveToPosition:r,disabled:l=!1,gridColumn:a,stabilizing:u=!1,allowMoveOnFocus:m,sx:o}=s,[d,v]=he(),{onEnter:i,onLeave:c}=s,f=oe(ve((n==null?void 0:n.properties.detector)??null)),g=(f==null?void 0:f.properties.size)??[0,0],T=t.pixel_size*g[0],_=((O=o==null?void 0:o.properties)==null?void 0:O.tolerance)??.001,b=((A=o==null?void 0:o.properties)==null?void 0:A.display_digits)??3,C=((S=o==null?void 0:o.properties)==null?void 0:S.position)??null,$=((k=o==null?void 0:o.properties)==null?void 0:k.limits)??[0,1],F=((M=o==null?void 0:o.properties)==null?void 0:M.unit)??"mm",D=C!==null?Math.abs(t.position-C)<_:!1,j=t.position>=$[0]&&t.position<=$[1],N=t.distanceName==="focal",I=D?u?"warning":"primary":j?"secondary":"danger",R=j?"":"Position is outside of the axis limits";function H(){return N?e.jsx("h5",{className:"py-1",children:"Focal"}):e.jsx("h5",{className:`rounded-4 bg-${I} text-bg-${I} py-1`,children:`Distance ${t.distanceNum}`})}h.useEffect(()=>{v?i==null||i():c==null||c()},[v]);const p=z(t.z1,"mm","um",b-3),y=z(t.pixel_size,"um","nm",3),Y=z(T,"um","um",3),q=z(t.position,F,F,b);return e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{gridColumn:a,gridRow:1},className:"text-center",title:R,children:e.jsx(H,{})}),e.jsx("div",{style:{gridColumn:a,gridRow:2},className:"text-center",children:p}),e.jsx("div",{style:{gridColumn:a,gridRow:3},className:"text-center",children:!N&&`${y}`}),e.jsx("div",{style:{gridColumn:a,gridRow:4},className:"text-center",children:!N&&`${Y}`}),e.jsx("div",{style:{gridColumn:a,gridRow:6},title:R,className:`text-center ${j?"":"text-danger"}`,children:q}),e.jsx("div",{style:{gridColumn:a,gridRow:7},title:`${j?"":"Position is outside of the axis limits"}${j&&u?"Waiting for stabilization":""}`,children:!(N&&!m)&&e.jsx(w,{ref:d,className:"w-100",variant:D?u?"warning":"primary":"secondary",onClick:()=>{r(t.distanceName)},disabled:l||!j||u,children:"Move to"})})]})}function ye(s){const{tomoDetector:t,gridColumn:n}=s;if(t===null)return e.jsx(e.Fragment,{});function r(){return((t==null?void 0:t.properties.detector)??"").replace("hardware:","")}const l=r(),a=t.properties.source_distance;return e.jsxs(e.Fragment,{children:[e.jsx("div",{style:{gridColumn:n,gridRow:1},className:"text-center",children:e.jsx("h5",{className:"py-1",children:"Detector"})}),e.jsx("div",{style:{gridColumn:n,gridRow:2},className:"text-center",children:a&&e.jsxs(e.Fragment,{children:[a.toFixed(2)," mm"]})}),e.jsxs("div",{style:{gridColumn:n,gridRow:5,zIndex:1},className:"text-center text-middle my-auto",children:[e.jsx("img",{className:"mx-auto my-auto",src:"resources/tomo/holo-detector.png",alt:"Detector",style:{gridColumn:7,gridRow:2,width:"92px",height:"92px",zIndex:0,imageRendering:"pixelated"}}),e.jsx("br",{}),l]})]})}function we(s){const t=s.includes("_hd.")?"default":"pixelated";return{"--sprite-sheet":`url(${s})`,"--spritesheet-rendering":t}}function be(s,t){var a;const n=ie(((a=s==null?void 0:s.properties.sample_stage)==null?void 0:a.slice(9))??null),r=(n==null?void 0:n.properties.x_axis_focal_pos)??null,l=(t==null?void 0:t.properties.distances)??[];return h.useMemo(()=>{const u=[];r&&u.push({distanceName:"focal",distanceNum:-1,pixel_size:0,position:r,z1:0});for(const[m,o]of l.entries())u.push({...o,distanceName:`dist${m+1}`,distanceNum:m+1});return u},[r,l])}function Ce(s){var j,N,I,R,H;const{options:t}=s,{tomoconfig:n}=t,r=J(n??""),l=X(n??""),a=fe((l==null?void 0:l.holotomo)??null),u=V((a==null?void 0:a.id)??null),m=ee((l==null?void 0:l.tomoDetector)??null),o=te(),d=se((l==null?void 0:l.sx)??null),v=V((d==null?void 0:d.id)??null),i=(d==null?void 0:d.properties.state[0])==="MOVING",c=be(r,a),[f,g]=h.useState(!1),_=((j=ne().avatar)==null?void 0:j.sprite_sheet)??"resources/tomo/fox-yellow.png";if(!a)return e.jsx(L,{variant:"warning",children:"No holotomo object found"});function b(p){u.call("move",p)}const C=f;function $(){if(d===null)return"tomo-avatar";if(!i)return C?"tomo-avatar stand":"tomo-avatar";const p=d.properties;return p.position===null||p.target===null?"tomo-avatar":p.position<p.target?"tomo-avatar walk-right":p.position>p.target?"tomo-avatar walk-left":"tomo-avatar"}const F=$(),D=me(d,"sx");return e.jsxs("div",{className:"w-100",style:{flex:"1 1 0%",display:"flex",flexDirection:"column"},children:[e.jsx("h2",{children:"Configuration"}),e.jsxs(E,{className:"g-0",children:[e.jsx(x,{className:"p-1 text-nowrap my-auto",xs:2,children:e.jsx("div",{children:"State"})}),e.jsx(x,{className:"p-1",xs:3,children:e.jsx(pe,{hardware:a})})]}),e.jsxs(E,{className:"g-0",children:[e.jsx(x,{className:"p-1 text-nowrap my-auto",xs:2,children:e.jsx("div",{children:"Nb distances"})}),e.jsx(x,{className:"p-1",xs:3,children:e.jsx(ge,{value:(N=a.properties)==null?void 0:N.nb_distances,onValueChanged:p=>{u.setProperty("nb_distances",p)},disabled:!o})})]}),e.jsxs(E,{className:"g-0",children:[e.jsx(x,{className:"p-1 text-nowrap my-auto",xs:2,children:e.jsx("div",{children:"Pixel size"})}),e.jsx(x,{className:"p-1",xs:3,children:e.jsx(G,{value:(I=a.properties)==null?void 0:I.pixel_size,onValidate:p=>{u.setProperty("pixel_size",p)},coef:1e3,readOnly:!o})}),e.jsx(x,{className:"p-1 text-nowrap my-auto",xs:1,children:e.jsx("div",{title:"Nanometer",children:"nm"})}),e.jsx(x,{className:"p-1",xs:1,children:e.jsx(w,{variant:"secondary",onClick:()=>{u.setProperty("pixel_size",null)},disabled:!o||(((R=a.properties)==null?void 0:R.pixel_size)??null)===null,children:e.jsx("i",{className:"fa fa-trash"})})})]}),e.jsxs(E,{className:"g-0",children:[e.jsx(x,{className:"p-1 text-nowrap my-auto",xs:2,children:e.jsxs("div",{children:["Sample position (",D,")"," ",d!==null&&e.jsx(P,{id:d==null?void 0:d.id,options:{header:"none",variant:"state"}})]})}),e.jsx(x,{className:"p-1 text-nowrap my-auto",xs:3,children:e.jsx("div",{children:d!==null&&e.jsx(P,{id:d==null?void 0:d.id,options:{header:"none"}})})}),e.jsx(x,{className:"p-1 text-nowrap my-auto",xs:1}),e.jsx(x,{className:"p-1",xs:1,children:e.jsx(w,{style:{visibility:i?"visible":"hidden"},variant:"danger",onClick:()=>{v.call("stop")},disabled:!o,children:e.jsx("i",{className:"fa fa-xmark"})})})]}),e.jsxs(E,{className:"g-0",children:[e.jsx(x,{className:"p-1 text-nowrap my-auto",xs:2,children:e.jsxs("div",{children:["Settle time",e.jsx("br",{}),e.jsx("small",{children:"(used during acquisition)"})]})}),e.jsx(x,{className:"p-1",xs:3,children:e.jsx(G,{value:(H=a.properties)==null?void 0:H.settle_time,onValidate:p=>{u.setProperty("settle_time",p)},readOnly:!o})}),e.jsx(x,{className:"p-1 text-nowrap my-auto",xs:1,children:e.jsx("div",{title:"Second",children:"s"})})]}),e.jsx("h2",{children:"Distances"}),c.length===0&&e.jsx(L,{variant:"warning",children:"No distances are setup"}),c&&c.length>0&&e.jsxs(re,{style:{display:"grid",gridGap:5,gridTemplateColumns:`auto 1fr 1fr ${"2fr ".repeat(c.length)}`},children:[e.jsx("div",{style:{gridColumn:1,gridRow:1},children:" "}),e.jsx("div",{style:{gridColumn:1,gridRow:2},className:"text-end",title:"Distance from the focal plan",children:"Distance"}),e.jsx("div",{style:{gridColumn:1,gridRow:3},className:"text-end",children:"Pixel size"}),e.jsx("div",{style:{gridColumn:1,gridRow:4},className:"text-end",children:"Field of view"}),e.jsxs("div",{style:{gridColumn:1,gridRow:6},className:"text-end",title:"Position in the x-translation axis",children:[D," position"]}),c.map((p,y)=>e.jsx(Ne,{gridColumn:`${y===0?y+2:y+3} / ${y+4}`,distance:p,tomoDetector:m,moveToPosition:b,disabled:!o||a.properties.state!=="READY",sx:d,stabilizing:a.properties.state==="STABILIZING",onEnter:()=>g(!0),onLeave:()=>g(!1),allowMoveOnFocus:t.enable_move_on_focal_plan??!0},y)),e.jsx("img",{className:"w-100 my-auto",alt:"Beam",src:"resources/tomo/holo-beam.svg",style:{gridColumn:`3 / ${c.length+4}`,gridRow:5,height:"8em",zIndex:0,objectFit:"fill"}}),e.jsx(je,{thumbClassName:`${F}`,style:{gridColumn:`2 / ${c.length+3}`,gridRow:5,zIndex:1},thumbStyle:we(_),thumbTitle:"I am the sample",variant:i?"info":"primary",position:(d==null?void 0:d.properties.position)??null,distances:c}),e.jsx(ye,{tomoDetector:m,gridColumn:c.length+3})]})]})}function _e(s){return e.jsx(Ce,{...s})}function Re(s){const{yamlNode:t,tomoconfig:n,enable_move_on_focal_plan:r,...l}=s;ce(t,"tomoconfig",n),de(t,"enable_move_on_focal_plan",r),ue(t,l);const a={tomoconfig:n,enable_move_on_focal_plan:r};return e.jsx(_e,{options:a})}export{Re as default};
@@ -0,0 +1 @@
1
+ import{aK as Z,b5 as J,j as e,aH as O,as as G,B as f,aJ as w,r as u,aL as ne,u as L,F as oe,C as B,R as re,aT as le,aR as ce,aS as de,ad as me,H as xe}from"./index-b3c0133a.js";import{u as he,b as ue}from"./TomoDetector-e04a5a8b.js";import{A,u as fe}from"./colormap-6e43299c.js";import{A as X,D as c,e as je,F as ye,a as pe,b as ve,C as ge,H as Y,R as Me,c as Ce,I as Re,d as Se}from"./RectRuler-1fee3fd8.js";import{V as U}from"./VLineRoi-b38fe841.js";import{b as ee,O as we}from"./index-a9bb7636.js";import{H as De}from"./HSegment-8d2c001e.js";import{L as be}from"./Label-9d8979b3.js";import{A as K}from"./DraggableRect-25d91c7d.js";import{a as Ne,T as q,D as Ie,S as Q,L as Le}from"./UseMouseModeInteraction-51c6269c.js";import{S as Oe}from"./SceneScale-e2a42af2.js";import{S as ke,R as He,a as Ae}from"./RulerButton-a95a6035.js";import{a as Ge,N as Ve,d as Pe,c as Fe}from"./hooks-171c0765.js";import{D as Te}from"./DropdownButton-29cc265b.js";import{a as Ue}from"./ColorMap-be59ad21.js";import"./ScreenScale-b2417934.js";import"./Anchor-0b4a3d33.js";import"./VSegmentRoi-d5e035cc.js";import"./QtyHelper-8429914f.js";import"./types-c366a377.js";function Ee(i){const{geometry:s,lineWidth:a=2,color:d="blue",opacity:x=1,zIndex:l=1,visible:n=!0,readOnly:m=i.onGeometryChanged===void 0}=i,C=i.unit===void 0?"":` ${i.unit}`,o=ee(),[j,r]=Z.useState(void 0);if(J(({camera:h})=>{const p=o.getVisibleDomains(h),M=.9;r(p.yVisibleDomain[0]*M+p.yVisibleDomain[1]*(1-M))}),!n)return e.jsx(e.Fragment,{});const y=s.gap*.5,g=s.x-Math.abs(y),D=s.x+Math.abs(y);function V(h,p){var R;const{x:M}=h;(R=i.onGeometryChanged)==null||R.call(i,{...s,x:M},p)}function b(h,p){var S;const{x:M}=h,R=(s.x+y+M)*.5,H=s.x+y-M;(S=i.onGeometryChanged)==null||S.call(i,{gap:p?H:Math.abs(H),x:R},p)}function k(h,p){var S;const{x:M}=h,R=(s.x-y+M)*.5,H=M-(s.x-y);(S=i.onGeometryChanged)==null||S.call(i,{gap:p?H:Math.abs(H),x:R},p)}const P=`${s.gap.toFixed(2)}${C}`;return e.jsxs(e.Fragment,{children:[e.jsx(U,{geometry:{x:s.x},zIndex:l,color:d,opacity:x*.5,readOnly:m,lineWidth:a,onGeometryChanged:V}),e.jsx(U,{geometry:{x:s.x-y},zIndex:l,color:d,opacity:x,readOnly:m,lineWidth:a,onGeometryChanged:b}),e.jsx(U,{geometry:{x:s.x+y},zIndex:l,color:d,opacity:x,readOnly:m,lineWidth:a,onGeometryChanged:k}),j!==void 0&&e.jsxs(e.Fragment,{children:[e.jsx(De,{zIndex:l+.01,x1:g,x2:D,y:j,lineWidth:2,color:"red"}),e.jsx(X,{zIndex:l+.01,x:g,y:j,sizeInScreen:K,angle:180,color:"red",lineWidth:2}),e.jsx(X,{zIndex:l+.01,x:D,y:j,sizeInScreen:K,angle:0,color:"red",lineWidth:2}),e.jsx(be,{text:P,datapos:[s.x,j],anchor:"top",hmargin:15,outline:"#FFFFFF80"})]})]})}function ze(i){const{y:s,visible:a=!0}=i,d=ee(),[x,l]=Z.useState(void 0);return J(({camera:n})=>{const m=d.getVisibleDomains(n);l(m.xVisibleDomain[1])}),e.jsx(e.Fragment,{children:a&&x!==void 0&&e.jsx(we,{x,y:s,children:e.jsx("div",{className:"",style:{transform:"translate(-100%, -50%)"},children:e.jsxs("div",{className:"bg-danger text-light p-1 rounded me-3",children:[e.jsx("i",{className:"fa fa-image fa-fw"}),e.jsx("br",{}),e.jsx("i",{className:"fa fa-camera fa-fw"})]})})})})}function _e(i){const{config:s}=i;return e.jsxs(Te,{title:e.jsx("i",{title:"Extra options",className:"fa fa-sliders fa-fw fa-lg"}),variant:"secondary",children:[e.jsxs(O.Header,{children:[e.jsx("h5",{style:{width:"8em"},children:"Auto contrast"}),e.jsxs(G,{children:[e.jsx(f,{variant:s.autoscaleMode===A.None?"primary":"secondary",onClick:()=>{s.setAutoscaleMode(A.None)},children:"None"}),e.jsx(f,{variant:s.autoscaleMode===A.Minmax?"primary":"secondary",onClick:()=>{s.setAutoscaleMode(A.Minmax)},children:"Min/max"}),e.jsx(f,{variant:s.autoscaleMode===A.StdDev3?"primary":"secondary",onClick:()=>{s.setAutoscaleMode(A.StdDev3)},children:"3×std"})]})]}),e.jsx(O.Header,{children:e.jsxs(w,{direction:"horizontal",children:[e.jsx("h5",{style:{width:"8em"},children:"Vertical line"}),e.jsx(f,{title:"Show/hide a vertical line",variant:s.displayVLine?"primary":"secondary",onClick:()=>{s.setDisplayVLine(a=>!a)},children:e.jsx("i",{className:`fa ${s.displayVLine?"fa-eye":"fa-eye-slash"} fa-fw fa-lg`})})]})}),e.jsx(O.Header,{children:e.jsxs(w,{direction:"horizontal",children:[e.jsx("h5",{style:{width:"8em"},children:"Horizontal line"}),e.jsx(f,{title:"Show/hide an horizontal line",variant:s.displayHLine?"primary":"secondary",onClick:()=>{s.setDisplayHLine(a=>!a)},children:e.jsx("i",{className:`fa ${s.displayHLine?"fa-eye":"fa-eye-slash"} fa-fw fa-lg`})})]})}),e.jsx(O.Header,{children:e.jsxs(w,{direction:"horizontal",children:[e.jsx("h5",{style:{width:"8em"},children:"Vertical center"}),e.jsx(f,{title:"Show/hide vertical center",variant:s.displayVCenter?"primary":"secondary",onClick:()=>{s.setDisplayVCenter(a=>!a)},children:e.jsx("i",{className:`fa ${s.displayVCenter?"fa-eye":"fa-eye-slash"} fa-fw fa-lg`})})]})}),e.jsx(O.Header,{children:e.jsxs(w,{direction:"horizontal",children:[e.jsx("h5",{style:{width:"8em"},children:"Show axes"}),e.jsx(f,{title:"Show/hide the axes",variant:s.displayAxes?"primary":"secondary",onClick:()=>{s.setDisplayAxes(!s.displayAxes)},children:e.jsx("i",{className:`fa ${s.displayAxes?"fa-eye":"fa-eye-slash"} fa-fw fa-lg`})})]})}),e.jsx(O.Header,{children:e.jsxs(w,{direction:"horizontal",children:[e.jsx("h5",{style:{width:"8em"},children:"Axis unit"}),e.jsxs(G,{children:[e.jsx(f,{title:"Display axis as pixel",variant:s.preferedUnit==="px"?"primary":"secondary",onClick:()=>{s.setPreferedUnit("px")},children:"px"}),e.jsx(f,{title:"Display axis as milimeter if possible",variant:s.preferedUnit==="mm"?"primary":"secondary",onClick:()=>{s.setPreferedUnit("mm")},children:"mm"}),e.jsx(f,{title:"Display axis as micrometer if possible",variant:s.preferedUnit==="um"?"primary":"secondary",onClick:()=>{s.setPreferedUnit("um")},children:"µm"})]})]})})]})}function Be(i){const{value:s,onChanged:a,mixedMode:d,onMixedModeChanged:x}=i;function l(m){return m>=100&&m<300}function n(m){return e.jsx(f,{variant:s===m.value?"primary":"secondary",onClick:()=>{a(m.value),x(m.value)},children:m.children})}return e.jsxs(ke,{title:e.jsx("i",{title:"Blend the two images",className:"fa fam-compare-mode fa-lg"}),variant:l(s)?"primary":"secondary",align:{lg:"start"},autoClose:!1,onClick:()=>{a(d)},children:[e.jsxs(O.Header,{children:[e.jsxs("h5",{children:[e.jsx("i",{className:"fa fam-compare-mode"})," Grey scale"]}),e.jsxs(G,{children:[e.jsx(n,{value:c.MIN,children:"Min"}),e.jsx(n,{value:c.MAX,children:"Max"}),e.jsx(n,{value:c.DIFF,children:"Diff"}),e.jsx(n,{value:c.ERROR,children:"Error"}),e.jsx(n,{value:c.MUL,children:"A×B"}),e.jsx(n,{value:c.HSPLITTER,children:"Split"})]})]}),e.jsxs(O.Header,{children:[e.jsxs("h5",{children:[e.jsxs("span",{className:"fa-stack",children:[e.jsx("i",{className:"fa fam-compare-mode-left fa-stack-1x",style:{color:"cyan"}}),e.jsx("i",{className:"fa fam-compare-mode-center fa-stack-1x"}),e.jsx("i",{className:"fa fam-compare-mode-right fa-stack-1x",style:{color:"lime"}})]})," ","Green & Cyan"]}),e.jsxs(G,{children:[e.jsx(n,{value:c.MIN_COLOR,children:"Min"}),e.jsx(n,{value:c.MAX_COLOR,children:"Max"}),e.jsx(n,{value:c.DIFF_COLOR,children:"Diff"}),e.jsx(n,{value:c.ERROR_COLOR,children:"Error"}),e.jsx(n,{value:c.MUL_COLOR,children:"A×B"}),e.jsx(n,{value:c.HSPLITTER_COLOR,children:"Split"})]})]})]})}function $e(i){const{value:s,onChanged:a,mixedMode:d,onMixedModeChanged:x}=i;return e.jsxs(G,{children:[e.jsx(f,{variant:s===c.IMAGE_A?"info":"secondary",title:"Only display the image from the detector",onClick:()=>{a(c.IMAGE_A)},children:e.jsx("i",{className:"fa fam-hardware-camera fa-fw fa-lg"})}),e.jsx(f,{variant:s===c.IMAGE_B?"success":"secondary",title:"Only display saved reference image",onClick:()=>{a(c.IMAGE_B)},children:e.jsx("i",{className:"fa fa-image fa-fw fa-lg"})}),e.jsx(Be,{value:s,onChanged:l=>{a(l)},mixedMode:d,onMixedModeChanged:x})]})}function We(i){const{updateRoi:s,pixelSize:a,distanceMM:d,sceneUnit:x}=i,l=(a==null?void 0:a.scalar)??1,n=je(l);function m(o,j,r){if(o===void 0)return;const{x:y,gap:g}=o,D=r/j;return{x:y*D,gap:g*D}}function C(o,j,r){return r===void 0?o:j===void 0?void 0:{x:(o==null?void 0:o.x)??0,gap:j===0?0:ne(j,"mm").to(r).scalar}}u.useMemo(()=>{n!==void 0&&l!==n&&s(o=>m(o,n,l))},[l,n,s]),u.useMemo(()=>{s(o=>C(o,d,x))},[d,x,s])}function Xe(i){var W;const{pixelSize:s,config:a}=i,d=u.useRef(null),[x,l]=L("tomo/align/mixedmode",c.MIN_COLOR),[n,m]=L("tomo/align/displaymode",c.MIN_COLOR),[C,o]=u.useState(void 0),[j,r]=u.useState(void 0),[y,g]=u.useState(0),[D,V]=u.useState(0),b=Ne("zoom"),{mouseMode:k}=b,[P,h]=u.useState(void 0),[p,M]=u.useState(ye.NONE),[R,H]=u.useState(0),S=Ge(),[E,T]=u.useState(0),[v,$]=u.useMemo(()=>s===void 0?["px",void 0]:a.preferedUnit==="px"?["px",s.to("mm").scalar]:[a.preferedUnit,s.to("mm").scalar],[a.preferedUnit,s]);We({updateRoi:r,sceneUnit:v,pixelSize:s,distanceMM:E}),pe({updateRoi:o,pixelSize:v==="px"||s==null?void 0:s.to(v)});const{imageA:N,imageB:I,clearReference:se,saveReference:ae}=i,[z,_]=((W=N==null?void 0:N[0])==null?void 0:W.shape)??[1024,1024],{abscissaConfig:te,ordinateConfig:ie}=u.useMemo(()=>{var F;const t=v==="px"?1:((F=s==null?void 0:s.to(v))==null?void 0:F.scalar)??1;return{abscissaConfig:{visDomain:[-_*t*.8,_*t*.8],label:`x (${v})`},ordinateConfig:{visDomain:[-z*t*.6,z*t*.6],label:`y (${v})`}}},[_,z,v,s]);return e.jsxs(w,{direction:"horizontal",gap:2,onKeyDown:t=>{t.key===" "&&(m(F=>F===c.IMAGE_A?c.IMAGE_B:c.IMAGE_A),t.preventDefault())},tabIndex:-1,style:i.style,children:[e.jsxs(w,{direction:"vertical",style:{alignSelf:"stretch",flexGrow:4,minWidth:0},children:[e.jsxs(q,{align:"center",style:{zIndex:1},children:[e.jsx(Ie,{mouseModeInteraction:b}),e.jsxs(G,{children:[e.jsx(f,{title:"Reset zoom",variant:"secondary",onClick:()=>{var t;(t=d==null?void 0:d.current)==null||t.actions.resetZoom()},children:e.jsx("i",{className:"fa fa-expand fa-fw fa-lg"})}),e.jsx(f,{disabled:!S[2].canUndo,title:"Undo the last changes applied to the corrections",variant:"secondary",onClick:()=>{S[2].undo()},children:e.jsx("i",{className:"fa fa-reply fa-fw fa-lg"})}),e.jsx(f,{disabled:!S[2].canRedo,title:"Redo the last reverted changes applied to the corrections",variant:"secondary",onClick:()=>{S[2].redo()},children:e.jsx("i",{className:"fa fa-share fa-fw fa-lg"})})]}),e.jsx(Q,{}),e.jsx(He,{mouseModeInteraction:b,extraMouseModes:{"measure-rect":"fam-roi-rect"},onClear:()=>{o(void 0)},children:e.jsxs(O.Item,{active:k==="measure-rect",onClick:()=>{b.setMouseMode("measure-rect")},title:"Measure with a rectangle selection",children:[e.jsx("i",{className:"fa fa-fw fam-roi-rect fa-lg"}),"Measure rectangle"]})}),e.jsx($e,{value:n,onChanged:t=>{m(t)},mixedMode:x,onMixedModeChanged:l}),e.jsx(ve,{value:p,onSelect:t=>{M(t)}}),e.jsx(Q,{}),e.jsx(_e,{config:a})]}),e.jsx(u.Suspense,{fallback:null,children:e.jsxs(Le,{plotRef:d,abscissaConfig:te,ordinateConfig:ie,aspect:"equal",showAxes:a.displayAxes,onMouseInteractionOverlayChanged:h,mouseMode:k,children:[e.jsx(Oe,{unit:v}),e.jsx(ge,{imageA:N==null?void 0:N[0],imageB:I==null?void 0:I[0],stateA:N==null?void 0:N[1],stateB:I==null?void 0:I[1],displayMode:n,imageBTranslationX:-E/($??1),imageBFlipX:!1,pixelSize:v==="px"?void 0:(s==null?void 0:s.to(v).scalar)??void 0,autoScale:a.autoscaleMode,verticalSeparator:R,filterMode:p}),e.jsx(U,{geometry:{x:y},onGeometryChanged:t=>{g(t.x)},visible:a.displayVLine}),e.jsx(Y,{geometry:{y:D},onGeometryChanged:t=>{V(t.y)},visible:a.displayHLine}),C&&e.jsx(Me,{geometry:C,onGeometryChanged:t=>{o(t)},color:"red",unit:v}),e.jsx(Y,{geometry:{y:R},color:"red",onGeometryChanged:t=>{H(t.y)},visible:n===c.HSPLITTER||n===c.HSPLITTER_COLOR}),e.jsx(U,{geometry:{x:0},visible:a.displayVCenter,color:"red",readOnly:!0,lineWidth:1.5,opacity:1}),j&&e.jsx(Ee,{geometry:j,onGeometryChanged:t=>{r(t);const F=t.gap*($??0)/(v!=="px"?(s==null?void 0:s.to(v).scalar)??0:1);T(F)},unit:v}),e.jsx(ze,{y:R,visible:n===c.HSPLITTER||n===c.HSPLITTER_COLOR}),e.jsx(Ae,{mouseMode:k,disabled:P!==void 0,plotUnit:"mm"}),e.jsx(Ce,{enabled:k==="measure-rect",setIntermediateRoi:t=>{o(t)},setRoi:t=>{o(t),b.resetMouseMode()}})]})})]}),e.jsxs(w,{direction:"vertical",gap:2,className:"m-1",style:{width:"20em"},children:[e.jsx("h4",{children:"Pusher procedure"}),"Helper to align the sample to the center of rotation.",e.jsx("br",{}),e.jsxs("ul",{children:[e.jsx("li",{children:"Save the actual image as a reference"}),e.jsx("li",{children:"Specify in the input the distance to push"}),e.jsx("li",{children:"Push the sample to match the reference"})]}),e.jsx("h4",{children:"Reference"}),e.jsx(q,{align:"center",children:e.jsxs(G,{children:[e.jsxs(f,{title:"Use the actual acquisition as the alignement reference",onClick:()=>{ae()},children:[e.jsx("i",{className:"fa fa-image"})," Save as reference"]}),e.jsx(f,{disabled:(I==null?void 0:I[0])===void 0,variant:"danger",onClick:()=>{se()},children:e.jsx("i",{className:"fa fa-xmark fa-fw"})})]})}),e.jsxs(w,{direction:"horizontal",gap:2,className:"mt-3",style:{alignItems:"stretch"},children:[e.jsx(oe.Label,{className:"h5",style:{width:"5em"},title:"Distance to move the sample",children:"Distance"}),e.jsx(B,{children:e.jsxs(w,{direction:"vertical",gap:2,children:[e.jsx(Re,{step:.001,value:E,unit:"mm",displayUnit:"um",decimals:3,onChange:t=>{T(t)},onIntermediateChange:t=>{T(t)}}),e.jsxs(re,{children:[e.jsxs(B,{sm:"3",className:"text-nowrap",children:[e.jsx("i",{className:"fa fa-fw fa-plus-minus"}),"50"]}),e.jsx(B,{sm:"9",title:"Tune the distance",children:e.jsx(Se,{value:E,range:.025,step:1e-5,onChange:t=>{T(t)},onIntermediateChange:t=>{T(t)},title:"Tune the distance"})})]})]})})]})]})]})}function Ye(){const[i,s]=L("tomo/pusherview/colormap/autoscalemode",A.StdDev3),[a,d]=L("tomo/pusherview/axes",!0),[x,l]=L("tomo/pusherview/vline",!1),[n,m]=L("tomo/pusherview/hline",!1),[C,o]=L("tomo/pusherview/vcenter",!0),[j,r]=L("tomo/pusherview/crosshair",!1),[y,g]=L("tomo/pusherview/preferedunit","mm");return{autoscaleMode:i,setAutoscaleMode:s,displayAxes:a,setDisplayAxes:d,displayVLine:x,setDisplayVLine:l,displayHLine:n,setDisplayHLine:m,displayVCenter:C,setDisplayVCenter:o,crossHair:j,setCrossHair:r,preferedUnit:y,setPreferedUnit:g}}function Ke(i){var P;const{options:s}=i,a=Ye(),{tomoconfig:d}=s,x=le(),l=ce(d??""),n=de(l),m=((P=n.detector)==null?void 0:P.id)??"",C=x[m],o=he(),r=ue({detector:C,sampleStage:n,profile:o.profile,normalization:o.scaleType,autoscale:o.autoscale,autoscaleMode:o.autoscaleMode,domain:o.scaleDomain,histogram:!1,enabled:!0,minRefreshPeriod:.5,processing:Ue.Proj}).data;fe({statistics:r==null?void 0:r.statistics,...o});const y=u.useMemo(()=>{const h=r==null?void 0:r.imagePixelSize;if(h!=null)return h},[r==null?void 0:r.imagePixelSize]),g=u.useMemo(()=>{if(r===null)return;const{array:h,statistics:p}=r;return h instanceof Ve?[h,p]:h instanceof Pe?[h,p]:[Fe(h),r==null?void 0:r.statistics]},[r]),[D,V]=u.useState(void 0),b=u.useCallback(()=>{V(g)},[g]),k=u.useCallback(()=>{V(void 0)},[]);return e.jsx(Xe,{config:a,pixelSize:y,imageA:g,imageB:D,saveReference:b,clearReference:k,style:{flexGrow:1,flexShrink:1,minWidth:0,minHeight:0,alignSelf:"stretch",width:"100%",height:"100%"}})}function qe(i){return e.jsx(Ke,{...i})}function ys(i){const{yamlNode:s,tomoconfig:a,moveenabled:d,...x}=i;me(s,"tomoconfig",a),xe(s,x);const l={tomoconfig:a,moveenabled:d};return e.jsx(qe,{options:l})}export{ys as default};
@@ -0,0 +1,191 @@
1
+ var he=Object.defineProperty;var xe=(t,a,s)=>a in t?he(t,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[a]=s;var D=(t,a,s)=>(xe(t,typeof a!="symbol"?a+"":a,s),s);import{q as ge,bh as J,bi as pe,j as e,c as ve,r as y,aj as E,aL as H,u as O,as as U,B as P,aH as V,i as $,R as S,C as f,O as ye,L as F,aU as ie,aV as ne,aW as Q,aX as re,b5 as je,ag as k,aQ as le,b as ce,bj as Se,A as z,bk as be,bl as we,aR as Ce,aS as Ae,bm as ee,bn as Me,ad as te,bo as _e,H as De}from"./index-b3c0133a.js";import{u as Fe,L as Re,a as Ne,T as ae,D as Pe,S as ze}from"./UseMouseModeInteraction-51c6269c.js";import{S as ke}from"./StackedNameState-4e8dc742.js";import{a as G,r as Ie}from"./TomoService-e9741d6a.js";import{H as We}from"./HistogramDomainSlider-304bdab4.js";import{f as He,d as Te,g as Ee,h as qe,i as Le,j as se,k as Be}from"./hooks-171c0765.js";import{u as $e}from"./ColorMap-be59ad21.js";import{L as Oe,I as Ve,A as Ge}from"./AutoscaleOption-3cb99678.js";import{u as Ye}from"./colormap-6e43299c.js";import{u as Xe}from"./hooks-e0d9229c.js";import{w as Ue}from"./index-a9bb7636.js";import{C as Qe}from"./Cross-d5df0df3.js";import{S as Ke}from"./SceneScale-e2a42af2.js";import{p as A,f as Ze,c as Je}from"./geometry-cd448ec1.js";import{c as K,L as W}from"./Label-9d8979b3.js";import{C as et}from"./CrossMarker-71cd11cf.js";import{S as tt}from"./ScreenScale-b2417934.js";import{P as at}from"./SelectionPoint-a2cb4dfc.js";import"./Image-ee61818a.js";import"./HSegment-8d2c001e.js";import"./VSegment-f0d42c9a.js";import"./QtyHelper-8429914f.js";function st(t){return t?t.status===null?["PROCESSING","warning"]:t.status===0?["FAILED","danger"]:t.status===1?["DONE","success"]:["UNKNOWN","fatal"]:["NONE","secondary"]}function ot(t){var r;const a=t.datacollectionid!==void 0&&t.programs!==void 0?{datacollectionid:t.datacollectionid,programs:t.programs,per_page:1,order:"desc"}:null,{data:s}=ge(J.getList,a);pe(J.getList,a);const o=(r=s.rows)==null?void 0:r[0],[i,n]=st(o);return e.jsx(ke,{className:t.className,name:`${t.name}`,state:i,stateVariant:n,description:`${t.description}`,minWidth:5})}const it=(t,a)=>({}),nt=(t,a)=>({}),rt=ve(it,nt)(ot);class q extends Error{}class lt{constructor(a,s){D(this,"isAborted");D(this,"request");D(this,"supportsFloat16Array");D(this,"error");D(this,"updateCallback");this.isAborted=!1,this.request=void 0,this.updateCallback=a,this.supportsFloat16Array=s}async fetchGroup(a){const s=await E.get("/h5grove/meta/",{...this.request,path:a});if(this.isAborted)throw new q;const o=s.data;if(o.type!=="group")throw new Error(`The path '${a}' is not a group`);let i;const n={},r={},l=async()=>{i=await this.fetchAttributes(a,o.attributes)},h=o.children.map(async c=>{c.type==="group"?r[c.name]=await this.fetchGroup(`${a}/${c.name}`):c.dtype==="|O"?n[c.name]=await this.fetchObjDataset(`${a}/${c.name}`,c):n[c.name]=await this.fetchDataset(`${a}/${c.name}`,c)});await Promise.all([...h,l()]);for(const c of o.children)if(this.isAborted)throw new q;if(i===void 0)throw new Error(`Attributes from path '${a}' was not fetched`);return{attrs:i,datasets:n,groups:r,name:o.name}}async fetchObjDataset(a,s){const o=await this.fetchAttributes(a,s.attributes),i=await E.get("/h5grove/data/",{...this.request,path:a,format:"json"}).then(n=>n.data).catch(n=>{});return{...s,attrs:o,data:i}}async fetchDataset(a,s){let o,i;const n=async()=>{o=await this.fetchAttributes(a,s.attributes)},r=this.supportsFloat16Array&&s.dtype==="<f2",l=async()=>{const h=await E.get("/h5grove/data/",{...this.request,path:a,format:"bin",dtype:r?"origin":"safe"},!0,"arraybuffer").then(m=>m.data).catch(m=>{console.error(m)});function c(m){if(!m)return;const g=s.shape.length===0?[1]:s.shape;if(r){const p=He(m,"<u2");return new Te(p,g)}const d=Ee(s.dtype);return qe(m,g,d)}i=c(h)};if(await Promise.all([l(),n()]),o===void 0)throw new Error(`Attributes from path '${a}' was not fetched`);return{...s,attrs:o,data:i}}async fetchAttributes(a,s){const i=(await E.get("/h5grove/attr/",{...this.request,path:a,attr_keys:s.map(r=>r.name)})).data,n={};return s.forEach(r=>{n[r.name]={...r,data:i[r.name]}}),n}async fetch(a){const{request:s}=a;if(this.isAborted=!1,this.request=s,s.datacollectionid===void 0){this.updateCallback({loading:!1});return}try{this.updateCallback({loading:!0});const o=await this.fetchGroup(s.path);if(this.isAborted)throw new q;this.updateCallback({loading:!1,group:o,request:s})}catch(o){if(!(o instanceof q)){const i=o instanceof Error?o.message:String(o);this.updateCallback({loading:!1,error:i,request:s})}}}abort(){this.isAborted=!0}}function ct(t){const[a,s]=y.useState({loading:!1});return y.useEffect(()=>{const o=new lt(s,t.supportsFloat16Array??!1);return o.fetch({request:{datacollectionid:t.datacollectionid,autoprocprogramid:t.autoprocprogramid,autoprocprogramattachmentid:t.autoprocprogramattachmentid,path:t.path,type:t.type}}),()=>{o.abort()}},[t.datacollectionid,t.autoprocprogramid,t.autoprocprogramattachmentid,t.path,t.type]),a}function dt(t){if(t===void 0||t.dtype!=="|O")return null;const a=t.data;return typeof a=="string"?[a]:t}function B(t){if(t===void 0||t.dtype!=="|O")return null;const a=t.data;return typeof a!="string"?null:a}function R(t){var s;if(!t)return null;const a=(s=t.data)==null?void 0:s.get(0);return a===void 0?null:a}function N(t){var o;if(!t)return null;const a=(o=t.data)==null?void 0:o.get(0);if(a===void 0)return null;const s=B(t.attrs.units);return s===null?null:new H(a,s)}function ut(){const t=$e({name:"tomo/slicecolormap"}),[a,s]=O("tomo/slicereconstruction/delta-beta",200),[o,i]=O("tomo/sliceview/axes",!0),[n,r]=O("tomo/sliceview/crosshair",!1);return{deltaBeta:a,setDeltaBeta:s,...t,displayAxes:o,setDisplayAxes:i,crossHair:n,setCrossHair:r}}function mt(t){const{as:a=void 0,className:s}=t;function o(i,n){const l=t.lut===i?"primary":"secondary";return e.jsx(P,{disabled:t.disabled,variant:l,onClick:()=>{t.onSelectLut(i)},className:"text-nowrap",title:n,size:"sm",children:e.jsx(Oe,{name:i})})}return e.jsxs(U,{as:a,className:s,children:[o("Greys","Gray"),o("Viridis","Viridis"),o("Cividis","Cividis"),o("Magma","Magma"),o("Inferno","Inferno"),o("Plasma","Plasma")]})}function ft(t,a){return t===a?"primary":"secondary"}function L(t){return e.jsx(P,{variant:ft(t.var,t.value),onClick:()=>{t.setter(t.value)},className:"text-nowrap",size:"sm",children:t.children})}function ht(t){const{as:a=void 0,variant:s="secondary",config:o}=t;return e.jsxs(V,{as:a,className:`${t.dropDirection==="up"?"dropup":""}`,children:[e.jsx(V.Toggle,{id:"dropdown-basic",variant:s,className:"d-flex align-items-center",children:e.jsx("i",{className:"fa fa-sliders fa-fw fa-lg"})}),e.jsx(V.Menu,{className:"dropdown-menu-center",children:e.jsx("div",{className:"ms-1 me-1",style:{minWidth:"300px"},children:e.jsxs($,{children:[e.jsxs(S,{children:[e.jsx(f,{className:"my-auto",children:"Colormap"}),e.jsx(f,{xs:7,children:e.jsx(mt,{lut:o.colorMap,onSelectLut:o.setColorMap})})]}),e.jsxs(S,{className:"mt-1",children:[e.jsx(f,{className:"my-auto",children:"Display axes"}),e.jsx(f,{xs:7,children:e.jsxs(U,{children:[e.jsx(L,{var:o.displayAxes,value:!0,setter:o.setDisplayAxes,children:"Yes"}),e.jsx(L,{var:o.displayAxes,value:!1,setter:o.setDisplayAxes,children:"No"})]})})]}),e.jsxs(S,{className:"mt-1",children:[e.jsx(f,{className:"my-auto",children:"Crosshair"}),e.jsx(f,{xs:7,children:e.jsxs(U,{children:[e.jsx(L,{var:o.crossHair,value:!0,setter:o.setCrossHair,children:"Yes"}),e.jsx(L,{var:o.crossHair,value:!1,setter:o.setCrossHair,children:"No"})]})})]})]})})})]})}class I extends Error{}function xt(t){if(!t)return null;const a=dt(t.attrs.signal);if(!a)throw new I("No signal found in NXdata");if(a.length!==1)throw new I(`Expect one and only one signal, found ${a.length}`);function s(w){try{const j=w.groups.histo,M=j.datasets.counts,C=j.datasets.bin_edges,_=M.data,u=C.data;return se(_),se(u),{values:_,bins:u}}catch(j){console.error(j);return}}function o(w){try{const j=w.groups.stats;return j===void 0?void 0:{min:R(j.datasets.min),max:R(j.datasets.max),minPositive:R(j.datasets.min_positive),mean:R(j.datasets.mean),std:R(j.datasets.std)}}catch{return}}const i=t.datasets[a[0]];if(!i)throw new I(`Dataset from signal ${a[0]} does not exists`);if(i.shape.length!==2)throw new I(`Dataset from signal ${a[0]} must be 2 ndim (found ${i.shape.length})`);const n=i.data;Le(n);const r=N(t.datasets.sample_x_axis),l=N(t.datasets.sample_y_axis),h=N(t.datasets.y_axis),c=N(t.datasets.sample_pixel_size),m=N(t.datasets.used_axis_position)||new H(0,"px"),g=N(t.datasets.estimated_axis_position)||new H(0,"px"),d=R(t.datasets.delta_beta),p=B(t.datasets.backend),x=B(t.datasets.cor_backend),v=B(t.datasets.source_filename);return{histogram:s(t),imageArray:n,sampxPosition:r,sampyPosition:l,syPosition:h,axisPosition:m,samplePixelSize:c,estimatedAxisPosition:g,deltaBeta:d,backend:p,corBackend:x,stats:o(t),sourceFilename:v}}function gt(t){const{event:a}=t,[s,o]=y.useState({});return y.useEffect(()=>{if(a&&a.type===t.type){const{datacollectionid:i,autoprocprogramid:n}=a;console.log("event",a),i!==void 0&&n!==void 0&&o(r=>({...r,[`${i}`]:n}))}},[t.event]),y.useMemo(()=>{if(t.datacollectionid===void 0)return;const i=s[`${t.datacollectionid}`];return i!==void 0&&s[`group${t.datacollectiongroupid}`]!==i&&o(n=>({...n,[`group${t.datacollectiongroupid}`]:i})),i??s[`group${t.datacollectiongroupid}`]},[s,t.datacollectionid])}function pt(t){var r,l,h,c,m;const{datacollectionid:a,actions:s}=t,o=((l=(r=t.reconstructionInfo)==null?void 0:r.estimatedAxisPosition)==null?void 0:l.scalar)??void 0,i=((c=(h=t.reconstructionInfo)==null?void 0:h.axisPosition)==null?void 0:c.scalar)??void 0,n=((m=t.reconstructionInfo)==null?void 0:m.sourceFilename)??void 0;return y.useEffect(()=>{o!==void 0&&a!==void 0&&(s==null||s.updateDataCollectionMeta(a,{sourceFilename:n}))},[n]),y.useEffect(()=>{o!==void 0&&a!==void 0&&(s==null||s.updateDataCollectionMeta(a,{estimatedCor:o}))},[o]),y.useEffect(()=>{o!==void 0&&a!==void 0&&(s==null||s.updateDataCollectionMeta(a,{actualCor:i,requestedCor:null}))},[i]),e.jsx(e.Fragment,{})}function vt(t){function a(){t.datacollectionid!==void 0&&t.actions.requestSliceReconstruction({datacollectionid:t.datacollectionid,filename:t.sourceFilename})}return e.jsx(P,{variant:"secondary",title:"Recompute the slice from the sinogram",disabled:t.datacollectionid===null,onClick:a,children:e.jsx("i",{className:"fa fa-rotate-right fa-solid"})})}function yt(t){const{fetchedResult:a,reconstructedInfo:s}=t;function o(i){var n,r,l,h;return s===null?e.jsxs(F,{id:"reconstructed-slice-info",...i,children:[e.jsx(F.Header,{as:"h3",children:"Displayed data info"}),e.jsx(F.Body,{children:"No data"})]}):e.jsxs(F,{id:"reconstructed-slice-info",...i,children:[e.jsx(F.Header,{as:"h3",children:"Displayed data info"}),e.jsx(F.Body,{children:e.jsxs($,{style:{width:"17em"},children:[a.request&&e.jsxs(e.Fragment,{children:[e.jsxs(S,{className:"g-0",children:[e.jsx(f,{children:"Collection ID"}),e.jsx(f,{children:(n=a==null?void 0:a.request)==null?void 0:n.datacollectionid})]}),e.jsxs(S,{className:"g-0",children:[e.jsx(f,{children:"Program ID"}),e.jsx(f,{children:((r=a==null?void 0:a.request)==null?void 0:r.autoprocprogramid)??"last"})]})]}),e.jsxs(S,{className:"g-0",children:[e.jsx(f,{children:"Backend"}),e.jsx(f,{children:s==null?void 0:s.backend})]}),e.jsxs(S,{className:"g-0",children:[e.jsx(f,{children:"COR backend"}),e.jsx(f,{children:s==null?void 0:s.corBackend})]}),e.jsxs(S,{className:"g-0",children:[e.jsx(f,{children:"Axis position"}),e.jsxs(f,{children:[(l=s.axisPosition)==null?void 0:l.scalar.toFixed(2)," px"]})]}),e.jsxs(S,{className:"g-0",children:[e.jsx(f,{children:"Delta/beta"}),e.jsx(f,{children:(h=s.deltaBeta)==null?void 0:h.toFixed(2)})]})]})})]})}return e.jsx(ye,{trigger:["hover","focus"],placement:"bottom",overlay:o,children:e.jsx(P,{variant:"secondary",disabled:s===null,children:e.jsx("i",{className:"fa-solid fa-info fa-fw fa-lg"})})},"arg")}function jt(t){function a(o,i){return Math.round(o)===o?o.toFixed(0):o.toFixed(i)}const s=4;return e.jsxs($,{style:{width:"150px"},children:[e.jsxs(S,{children:[e.jsx(f,{xs:3,children:"u"}),e.jsx(f,{xs:8,children:t.py.toFixed(s)}),e.jsx(f,{xs:1,children:t.inMotorSpace?"mm":"px"})]}),e.jsxs(S,{children:[e.jsx(f,{xs:3,children:"v"}),e.jsx(f,{xs:8,children:t.px.toFixed(s)}),e.jsx(f,{xs:1,children:t.inMotorSpace?"mm":"px"})]}),t.pixel&&e.jsxs(S,{children:[e.jsx(f,{xs:3,children:"pixel"}),e.jsx(f,{xs:8,children:a(t.pixel,s)}),e.jsx(f,{xs:1})]})]})}class St extends ne{constructor(){super({uniforms:{color:{value:new Q},gapColor:{value:new Q},radius:{value:0},dashSize:{value:0},gapSize:{value:0},scaleX:{value:0},scaleY:{value:0},lineWidth:{value:0}},vertexShader:`
2
+ uniform float scaleX; // signed scale
3
+ uniform float scaleY; // signed scale
4
+ out vec2 pixelCoord;
5
+ // out vec2 dataCoord;
6
+
7
+ void main() {
8
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
9
+ vec2 pixelScale = abs(vec2(scaleX, scaleY));
10
+ // dataCoord = vec2(position.x, position.y);
11
+ pixelCoord = vec2(position.x, position.y) / pixelScale;
12
+ }
13
+ `,fragmentShader:`
14
+ uniform vec4 color;
15
+ uniform vec4 gapColor;
16
+ uniform float gapSize;
17
+ uniform float dashSize;
18
+ uniform float lineWidth;
19
+ uniform float scaleX; // signed scale
20
+ uniform float scaleY; // signed scale
21
+ uniform float radius;
22
+ in vec2 pixelCoord;
23
+
24
+ const float M_PI = 3.1415926535897932384626433832795;
25
+ const float AA_DASH = 0.5;
26
+
27
+ /**
28
+ * Antialiasing following the line of dash and gap
29
+ */
30
+ vec4 aa_dash_gap(float dist, float alpha) {
31
+ dist = mod(dist, (dashSize + gapSize));
32
+ float sd1 = (dist < dashSize) ? dist : dist - (dashSize + gapSize);
33
+ float sd2 = -(dist - dashSize);
34
+ if (abs(sd1) <= AA_DASH || abs(sd2) <= AA_DASH) {
35
+ if (abs(sd1) < abs(sd2)) {
36
+ float c = (sd1 + AA_DASH) * (0.5 / AA_DASH);
37
+ return (
38
+ vec4(color.r, color.g, color.b, alpha * color.a) * c
39
+ + vec4(gapColor.r, gapColor.g, gapColor.b, alpha * gapColor.a) * (1.0 - c)
40
+ );
41
+ } else {
42
+ float c = (sd2 + AA_DASH) * (0.5 / AA_DASH);
43
+ return (
44
+ vec4(color.r, color.g, color.b, alpha * color.a) * c
45
+ + vec4(gapColor.r, gapColor.g, gapColor.b, alpha * gapColor.a) * (1.0 - c)
46
+ );
47
+ }
48
+ }
49
+ if (dist <= dashSize) {
50
+ return vec4(color.r, color.g, color.b, alpha * color.a);
51
+ }
52
+ return vec4(gapColor.r, gapColor.g, gapColor.b, alpha * gapColor.a);
53
+ }
54
+
55
+ void main() {
56
+ float r = length(pixelCoord);
57
+ float s = (abs(scaleX) + abs(scaleY)) * 0.5;
58
+ float d = abs(r - radius / s) - lineWidth * 0.5;
59
+ if (d > 1.5) {
60
+ discard;
61
+ }
62
+ float alpha;
63
+ if (lineWidth >= 1.0) {
64
+ alpha = smoothstep(0.25, 0.0, d);
65
+ } else {
66
+ // simulate line thiner than 1px with alpha
67
+ alpha = lineWidth;
68
+ }
69
+
70
+ if (dashSize == 0.0) {
71
+ gl_FragColor = vec4(color.r, color.g, color.b, alpha * color.a);
72
+ return;
73
+ }
74
+
75
+ // try to fit a fixed integer number of dashes + gaps
76
+ // could be computed in the vertex shader
77
+ float full = 2.0 * M_PI * (radius / s) / (dashSize + gapSize);
78
+ float coef = ceil(full) / full;
79
+
80
+ float dist = 2.0 * atan(pixelCoord.y, pixelCoord.x) * (radius / s) * coef;
81
+ gl_FragColor = aa_dash_gap(dist, alpha);
82
+ }
83
+ `})}}ie({CircleDashMaterial:St});function Y(t){const{center:a,radius:s,lineWidth:o=1,color:i="black",gapColor:n,dashSize:r=0,gapSize:l=r,opacity:h=1,zIndex:c=0}=t,m=y.useRef(null),g=Be();return y.useEffect(()=>{const d=K(i,h),p=K(n??"transparent",h);if(m.current){const x=m.current.uniforms;x.color.value=d,x.radius.value=s,x.gapColor.value=p,x.dashSize.value=r,x.gapSize.value=l,x.lineWidth.value=o,re()}},[i,s,n,r,l,h,o]),je(({camera:d})=>{if(m.current===null)return;const p=d.scale.x/g.sx,x=d.scale.y/g.sy,v=m.current.uniforms;v.scaleX.value=p,v.scaleY.value=x}),e.jsx("group",{position:[a[0],a[1],c],children:e.jsxs("mesh",{children:[e.jsx("ambientLight",{}),e.jsx("planeGeometry",{attach:"geometry",args:[(s+o)*2,(s+o)*2,1,1]}),e.jsx("circleDashMaterial",{attach:"material",transparent:!0,ref:m})]})})}function bt(t){const{sampleStage:a}=t,s=a.sampu?A(a.sampu):null,o=a.sampv?A(a.sampv):null,{tomoDetector:i,detector:n}=a;if(i===null||n===null||s===null||o===null)return e.jsx(e.Fragment,{});const r=Ze(i,n);if(r===null)return e.jsx(e.Fragment,{});const l=new k(o,s),h=r[0]*.5,c=r[0];function m(){const d=a.sy?A(a.sy):null;return d===null||r===null?null:r[0]*.5+Math.abs(d)}const g=m();return e.jsxs(e.Fragment,{children:[e.jsx(Y,{center:[l.x,l.y],radius:h,color:"#000000",gapColor:"#FF0000",opacity:.5,dashSize:5,gapSize:5,lineWidth:1}),e.jsx(W,{datapos:[l.x-h*.95,l.y-h*.35],color:"#FF0000",text:"Full"}),e.jsx(Y,{center:[l.x,l.y],radius:c,color:"#000000",gapColor:"#FF0000",opacity:.5,dashSize:5,gapSize:5,lineWidth:1}),e.jsx(W,{datapos:[l.x-c*.95,l.y-c*.35],color:"#FF0000",text:"Half"}),g!==null&&e.jsxs(e.Fragment,{children:[e.jsx(Y,{center:[l.x,l.y],radius:g,color:"#000000",gapColor:"#FF0000",dashSize:5,gapSize:5,lineWidth:1}),e.jsx(W,{datapos:[l.x-g,l.y-g*.175],color:"#FF0000",text:"Actual region"})]})]})}function wt(t){const{sampleStage:a}=t,s=a.sampu?A(a.sampu):null,o=a.sampv?A(a.sampv):null;return(a.sy?A(a.sy):null)===null||s===null||o===null?e.jsx(e.Fragment,{}):e.jsxs(e.Fragment,{children:[e.jsx(et,{x:o,y:s,color:"red",sizeInScreen:30,lineWidth:2.5}),e.jsx(W,{datapos:[o,s],color:"#FF0000",anchor:"top-right",text:"Actual axis position"})]})}class Ct extends ne{constructor(){super({uniforms:{color:{value:new Q},lineWidth:{value:0},sizeInScreen:{value:0},angle:{value:0}},vertexShader:`
84
+ out vec2 pixelCoord;
85
+
86
+ void main() {
87
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
88
+ pixelCoord = vec2(position.x, position.y);
89
+ }
90
+ `,fragmentShader:`
91
+ // Based on antialiased arrow fields
92
+ // Nicolas P. Rougier (http://www.loria.fr/~rougier)
93
+ // https://www.shadertoy.com/view/ldlSWj
94
+ // Released under BSD license.
95
+
96
+ uniform vec4 color;
97
+ uniform float lineWidth;
98
+ uniform float sizeInScreen;
99
+ uniform float angle;
100
+ in vec2 pixelCoord;
101
+
102
+ // Computes the signed distance from a line
103
+ float sdf_line(vec2 p, vec2 p1, vec2 p2) {
104
+ vec2 center = (p1 + p2) * 0.5;
105
+ float len = length(p2 - p1);
106
+ vec2 dir = (p2 - p1) / len;
107
+ vec2 rel_p = p - center;
108
+ return dot(rel_p, vec2(dir.y, -dir.x));
109
+ }
110
+
111
+ // Computes the signed distance from a line segment
112
+ float sdf_segment(vec2 p, vec2 p1, vec2 p2) {
113
+ vec2 center = (p1 + p2) * 0.5;
114
+ float len = length(p2 - p1);
115
+ vec2 dir = (p2 - p1) / len;
116
+ vec2 rel_p = p - center;
117
+ float dist1 = abs(dot(rel_p, vec2(dir.y, -dir.x)));
118
+ float dist2 = abs(dot(rel_p, dir)) - 0.5*len;
119
+ return max(dist1, dist2);
120
+ }
121
+
122
+ float sdf_arrow(vec2 texcoord,
123
+ float body, float head, float height,
124
+ float linewidth, float antialias
125
+ ) {
126
+ float d;
127
+ float w = linewidth/2.0 + antialias;
128
+ vec2 start = -vec2(body / 2.0, 0.0);
129
+ vec2 end = +vec2(body / 2.0, 0.0);
130
+
131
+ // Arrow tip (beyond segment end)
132
+ if( texcoord.x > body / 2.0) {
133
+ // Head : 2 segments
134
+ float d1 = sdf_line(texcoord, end, end - head*vec2(+1.0, -height));
135
+ float d2 = sdf_line(texcoord, end - head*vec2(+1.0, +height), end);
136
+ // Body : 1 segment
137
+ float d3 = end.x - texcoord.x;
138
+ d = max(max(d1, d2), d3);
139
+ } else {
140
+ // Head : 2 segments
141
+ float d1 = sdf_segment(texcoord, end - head * vec2(+1.0, -height), end);
142
+ float d2 = sdf_segment(texcoord, end - head * vec2(+1.0, +height), end);
143
+ // Body : 1 segment
144
+ float d3 = sdf_segment(texcoord, start, end - vec2(linewidth, 0.0));
145
+ d = min(min(d1, d2), d3);
146
+ }
147
+ return d;
148
+ }
149
+
150
+ vec4 filled(float distance, float linewidth, float antialias, vec4 fill)
151
+ {
152
+ vec4 frag_color;
153
+ float t = linewidth / 2.0 - antialias;
154
+ float signed_distance = distance;
155
+ float border_distance = abs(signed_distance) - t;
156
+ float alpha = border_distance / antialias;
157
+ alpha = exp(-alpha * alpha);
158
+
159
+ // Within linestroke
160
+ if (border_distance < 0.0) {
161
+ return fill;
162
+ }
163
+ // Within shape
164
+ if (signed_distance < 0.0) {
165
+ return fill;
166
+ }
167
+ // Outside shape
168
+ if (border_distance > (linewidth / 2.0 + antialias)) {
169
+ discard;
170
+ }
171
+ // Line stroke exterior border
172
+ return vec4(fill.rgb, alpha);
173
+ }
174
+
175
+ void main() {
176
+ const float M_PI = 3.1415926535897932384626433832795;
177
+
178
+ float theta = angle * M_PI / 180.0;
179
+ float cos_theta = cos(theta);
180
+ float sin_theta = sin(theta);
181
+ vec2 pixelCoord2 = vec2(
182
+ cos_theta * pixelCoord.x - sin_theta * pixelCoord.y,
183
+ sin_theta * pixelCoord.x + cos_theta * pixelCoord.y
184
+ );
185
+
186
+ const float antialias = 1.0;
187
+ float body = sizeInScreen;
188
+ float d = sdf_arrow(pixelCoord2, body, 0.30 * body, 0.8, lineWidth, antialias);
189
+ gl_FragColor = filled(d, lineWidth, antialias, color);
190
+ }
191
+ `})}}ie({ArrowMarkerMaterial:Ct});function X(t){const{x:a,y:s,color:o="black",opacity:i,sizeInScreen:n,angle:r,lineWidth:l=1,zIndex:h=0}=t,c=y.useRef(null);return y.useEffect(()=>{const m=K(o,i);if(c.current){const g=c.current.uniforms;g.color.value=m,g.lineWidth.value=l,g.sizeInScreen.value=n,g.angle.value=r,re()}},[o,i,l,n,r]),e.jsx("group",{position:[a,s,h],children:e.jsx(tt,{screenDirection:!1,children:e.jsxs("mesh",{children:[e.jsx("ambientLight",{}),e.jsx("planeGeometry",{attach:"geometry",args:[n+l,n+l,1,1]}),e.jsx("arrowMarkerMaterial",{attach:"material",transparent:!0,ref:c})]})})})}function At(t){const{sampleStage:a}=t,s=a.sampu?A(a.sampu):null,o=a.sampv?A(a.sampv):null,i=a.somega?-Je(a.somega):null;if(i===null||s===null||o===null)return e.jsx(e.Fragment,{});const n=i/Math.PI*180,r=(t.viewRange[0][1]-t.viewRange[0][0])*.5+(t.viewRange[1][1]-t.viewRange[1][0])*.5,l=new k(0,1).rotateAround(new k(0,0),i),h=new k(-l.y,l.x).multiplyScalar(.3*r),m=new k(o,s).clone().add(l.clone().multiplyScalar(.375*r)),g=m.clone().add(h),d=m,p=m.clone().sub(h);return e.jsxs(e.Fragment,{children:[e.jsx(X,{x:g.x,y:g.y,sizeInScreen:80,angle:90-n,color:"red",lineWidth:3}),e.jsx(X,{x:d.x,y:d.y,sizeInScreen:80,angle:90-n,color:"red",lineWidth:3}),e.jsx(X,{x:p.x,y:p.y,sizeInScreen:80,angle:90-n,color:"red",lineWidth:3}),e.jsx(W,{datapos:[d.x,d.y],color:"#FF0000",text:"Beam",anchor:"bottom"})]})}const oe=le("daiquiri.components.tomo.reconstructedslice.MoveMotorInteraction");function Mt(t){const a=Fe(),{mouseMode:s}=a??{},{disabled:o,requestMoveSampleAxisAtPosition:i}=t,n=y.useCallback(r=>{const l=r.dataPt.x,h=r.dataPt.y;i(h,l)},[i]);return o||s!=="move-sample-to-axis"?(oe("MoveMotorInteraction disabled."),e.jsx(e.Fragment,{})):(oe("MoveMotorInteraction enabled."),e.jsx(at,{onClick:n}))}function _t(t){var g;const{sampleStage:a,mouseMode:s}=t,o=(g=t.reconstructedInfo)==null?void 0:g.imageArray,i=y.useRef(null),n=ce();if(!t.reconstructedInfo||o===void 0)return e.jsx(e.Fragment,{});const l=(a.somega!==null?Se(a.somega):!0)?1:-1;function h(d){const p=(o==null?void 0:o.shape[1])??0,x=(o==null?void 0:o.shape[0])??0;if(d.samplePixelSize===null||d.sampxPosition===null||d.sampyPosition===null||d.imageArray===null)return{inMotorSpace:!1,xRange:[0,x],yRange:[0,p],center:[p/2,x/2,0],scale:[1,1,1],height:x,width:p};const v=d.samplePixelSize.to("mm").scalar,w=d.sampxPosition.to("mm").scalar,j=d.sampyPosition.to("mm").scalar,M=d.imageArray.shape[1]*.5,C=d.imageArray.shape[0]*.5;return{inMotorSpace:!0,xRange:[j-M*v,j+M*v],yRange:[w-C*v,w+C*v],center:[j,w,0],scale:[-v,-l*v,1],width:M*v*2,height:C*v*2}}const c=h(t.reconstructedInfo);function m(d,p){return d===null||!c.inMotorSpace?`${p} (px)`:`${d.alias??d.name} (mm)`}return e.jsx("div",{style:{flex:"1 1 auto",display:"flex",margin:0,minHeight:0},className:t.className,children:e.jsxs(Re,{plotRef:t.plotRef,abscissaConfig:{visDomain:c.xRange,label:m(a.sampv,"lateral-axis"),flip:!0},ordinateConfig:{visDomain:c.yRange,label:m(a.sampu,"x-axis")},mouseMode:s,aspect:"equal",showAxes:t.config.displayAxes,children:[e.jsx(Ve,{ref:i,values:o,domain:t.imageDomain,colorMap:t.imageColorMap,invertColorMap:t.imageInvertColorMap,position:c.center,scale:c.scale,scaleType:t.imageScaleType,size:{width:o.shape[1],height:o.shape[0]}}),e.jsx(Ue,{guides:t.config.crossHair?"both":void 0,renderTooltip:(d,p)=>{var v;const x=(v=i.current)==null?void 0:v.pick(d,p);return e.jsx(jt,{px:d,py:p,pixel:x,inMotorSpace:c.inMotorSpace})}}),e.jsx(Qe,{centerX:c.center[0],centerY:c.center[1],width:c.width,height:c.height,color:"white",gapColor:"black",dashSize:5,gapSize:5,lineWidth:1}),c.inMotorSpace&&e.jsxs(e.Fragment,{children:[e.jsx(bt,{sampleStage:a}),e.jsx(wt,{sampleStage:a}),e.jsx(At,{sampleStage:a,viewRange:[c.xRange,c.yRange]})]}),e.jsx(Mt,{disabled:!n,requestMoveSampleAxisAtPosition:t.requestMoveSampleAxisAtPosition}),e.jsx(Ke,{unit:c.inMotorSpace?"mm":"px"})]})})}function Dt(t){const{fetchedResult:a}=t;return t.datacollectionid===void 0?e.jsx(z,{variant:"secondary",children:"Not yet datacollection"}):t.autoprocprogramid===void 0&&a.group===void 0?e.jsxs(z,{variant:"secondary",children:["Not yet reconstruction for datacollection ",t.datacollectionid]}):a.loading?e.jsx(z,{variant:"warning",children:"Waiting for data"}):a.error?e.jsxs(z,{variant:"danger",children:[e.jsx("p",{children:"Error during fetching:"}),e.jsx("p",{children:a.error})]}):t.parsingError?e.jsxs(z,{variant:"danger",children:[e.jsx("p",{children:"Data format unsupported:"}),e.jsx("p",{children:t.parsingError})]}):e.jsx(e.Fragment,{})}const Ft=le("daiquiri.components.tomo.TomoReconstructedSinogram");function Rt(t){var Z;const{options:a}=t,s=be(a.datacollectionid),o=y.useRef(),i=(s==null?void 0:s.datacollectionid)??void 0,n=we(),{uri:r,tomoconfig:l,events:h,...c}=a,m=ce(),g=y.useRef(null),d=Ne("zoom"),{mouseMode:p}=d,x=ut(),v=Ce(l??""),w=Ae(v),j=Xe(t.options.events);function M(){g.current&&g.current.actions.resetZoom()}const C=gt({type:"tomo-sinogram-reconstruction",datacollectionid:s.datacollectionid,datacollectiongroupid:s.datacollectiongroupid,event:j??void 0});y.useEffect(()=>()=>{o.current&&clearTimeout(o.current)},[]);const _=ct({datacollectionid:s.datacollectionid,autoprocprogramid:C,type:"processing",path:r,supportsFloat16Array:!0}),[u,de]=y.useMemo(()=>{try{return[xt(_.group),void 0]}catch(b){if(b instanceof I)return[null,b.message];throw b}},[_]);function ue(b,T){if(d.resetMouseMode(),u===null){Ft("Move cancelled: reconstructedInfo is null");return}const me=H(b,"mm"),fe=H(T,"mm");Ie({sampu:me,sampv:fe})}return Ye({statistics:u==null?void 0:u.stats,...x}),e.jsxs("div",{className:"plot2d-container w-100 h-100",style:{flex:"1 1 0%",display:"flex",flexDirection:"column"},children:[e.jsxs(ae,{align:"center",children:[e.jsx(pt,{reconstructionInfo:u,datacollectionid:i,actions:n}),e.jsx(Pe,{mouseModeInteraction:d}),e.jsx(P,{title:"Reset zoom (sample stage overview)",variant:"secondary",onClick:()=>{M()},children:e.jsx("i",{className:"fa fa-expand fa-fw fa-lg"})}),e.jsx(ze,{}),e.jsx(P,{title:m?"Move the motors to set rotation axis on the sample":"You have to get the control on the session to move motors",disabled:!m,variant:p==="move-sample-to-axis"?"danger":"secondary",onClick:()=>{d.setOrResetMouseMode("move-sample-to-axis")},children:e.jsx("i",{className:"fa fam-arrow-h-over-rot fa-fw fa-lg"})}),e.jsx(rt,{name:"Worker",description:"Automatic slice reconstruction from sinogram",datacollectionid:s.datacollectionid,programs:"tomo-sinogram-reconstruction"}),e.jsx(vt,{datacollectionid:s.datacollectionid,sourceFilename:(u==null?void 0:u.sourceFilename)??void 0,actions:{requestSliceReconstruction:G}})]}),e.jsxs(ae,{align:"center",children:[e.jsx(Ge,{disabled:(u==null?void 0:u.stats)===void 0,...x}),e.jsx(We,{disabled:u===void 0,histogram:u==null?void 0:u.histogram,...x}),e.jsx(yt,{fetchedResult:_,reconstructedInfo:u}),e.jsx(ht,{config:x})]}),e.jsxs($,{children:[e.jsxs(S,{className:"g-0 align-items-center",children:[e.jsx(f,{xs:"3",title:"Location of the rotation axis from the left side of the sinogram (in pixel)",children:"Axis position:"}),e.jsx(f,{xs:"9",children:e.jsx(ee,{hardwareValue:((Z=u==null?void 0:u.axisPosition)==null?void 0:Z.scalar)??0,hardwareIsDisabled:u===null,onMoveRequested:b=>(s.datacollectionid!==void 0&&G({datacollectionid:s.datacollectionid,axisposition:b,deltabeta:x.deltaBeta,filename:(u==null?void 0:u.sourceFilename)??void 0}),null)})})]}),e.jsxs(S,{className:"g-0 align-items-center",children:[e.jsx(f,{xs:"3",title:"Delta/beta ratio for the Paganin filter",children:"Delta/beta:"}),e.jsx(f,{xs:"9",children:e.jsx(ee,{hardwareValue:x.deltaBeta,hardwareIsDisabled:!1,onMoveRequested:b=>{var T;return x.setDeltaBeta(b),s.datacollectionid!==void 0&&G({datacollectionid:s.datacollectionid,axisposition:(T=u==null?void 0:u.axisPosition)==null?void 0:T.scalar,deltabeta:b,filename:(u==null?void 0:u.sourceFilename)??void 0}),null}})})]})]}),e.jsx(Dt,{datacollectionid:s.datacollectionid,autoprocprogramid:C,fetchedResult:_,parsingError:de}),e.jsx(_t,{config:x,imageColorMap:x.colorMap,imageInvertColorMap:x.invertColorMap,imageDomain:x.scaleDomain,imageScaleType:x.scaleType,reconstructedInfo:u,className:"flex-grow-1",sampleStage:w,mouseMode:p,plotRef:g,requestMoveSampleAxisAtPosition:ue})]})}function Nt(t){return e.jsx(Rt,{...t})}function ta(t){const{yamlNode:a,datacollectionid:s,uri:o,tomoconfig:i,events:n,...r}=t;Me(a,"events",n),te(a,"tomoconfig",i),te(a,"uri",o),_e(a,"datacollectionid",s),De(a,r);const l={datacollectionid:s,uri:o,tomoconfig:i,events:n};return e.jsx(Nt,{options:l})}export{ta as default};
@@ -0,0 +1 @@
1
+ import{bq as L,r as j,j as t,aQ as R,br as v,o as k,bs as C,bt as m,bu as h,aD as E,bv as N,bw as D,l as w,H as q}from"./index-b3c0133a.js";import{g as I}from"./TomoScans-82e1e23b.js";function F(e,n){const r=L(e);j.useEffect(()=>{if(!n&&n!==0)return;const o=setInterval(()=>r.current(),n);return()=>clearInterval(o)},[n])}const T=R("daiquiri.components.tomo.TomoScanInfo");function b(e){return e==="tomo:dark"?["Dark","Acquire dark projection"]:e==="tomo:flat"?["Flat","Acquire flat projection"]:e==="tomo:return_ref"?["Return","Return to origin and acquiring few projection as reference"]:e==="tomo:step"?["Step scan","Tomo scan using rotation as step motor"]:e==="tomo:continuous"?["Continuous scan","Tomo scan using rotation as continuous motor"]:[e,"No description"]}function P(){const e=v();if(!e)return T("Skipped: lastgroup missing."),t.jsx(t.Fragment,{});const{subscans:n}=e;if(!n)return T("Skipped: subscans missing."),t.jsx(t.Fragment,{});const{activesubscan:r}=e;function o(s){return e?s<r?"DONE":s===r?e.state:"IDLE":""}const d=n.reduce((s,i)=>{const[a]=b(i);return s+a.length},0);function u(s,i,a){function x(S){return S.charAt(0).toUpperCase()+S.slice(1).toLowerCase()}const[f,l]=I(i),[c,p]=b(a),g=f==="RUNNING";return t.jsx(D,{animated:g,variant:l,label:`${x(c)}`,title:p,now:c.length,max:d},s)}return t.jsx(D,{children:w.map(n,(s,i)=>{const a=o(i);return u(i,a,s)})})}function Y(e){const[n,r]=j.useState(0);F(()=>{r(Date.now())},5e3);const o=j.useMemo(()=>{if(n<=0)return 0;const d=h(e.starttime),u=(n-d.getTime())/1e3;return u<0?0:u},[e.starttime,n]);return t.jsxs(t.Fragment,{children:[N(o)," ",t.jsx("i",{className:"fa-solid fa-spinner fa-spin-pulse"})]})}function $(e){const n=v(),r=k(C.get,n&&n?{datacollectionid:n.datacollectionid}:null);if(!n)return t.jsx(m,{children:t.jsx(m.Contents,{children:"No scan"})});const[o,d]=I(n.state);function u(f){const{subscans:l}=f;if(!l)return"";const{activesubscan:c}=f;if(c<0)return"Not yet started";if(c+1===l.length&&f.state!=="STARTING")return"Done";const p=l[c],[,g]=b(p);return`${c+1}/${l.length}: ${g}`}const{starttime:s,endtime:i,duration:a}=r??{},x=u(n);return t.jsx(m,{children:t.jsx(m.Contents,{children:t.jsxs("ul",{children:[n.datacollectionid&&t.jsxs("li",{children:[t.jsx("b",{children:"Data collection"}),": ",n.datacollectionid]}),t.jsxs("li",{children:[t.jsx("b",{children:"Scan"}),": ",n.scanid]}),t.jsxs("li",{children:[t.jsx("b",{children:"Start"}),":"," ",s?h(s).toLocaleTimeString():""]}),t.jsxs("li",{children:[t.jsx("b",{children:"Status"}),":"," ",t.jsx(E,{bg:d,title:`BLISS state: ${n.state}`,children:o})]}),t.jsxs("li",{children:[t.jsx("b",{children:"Progress"}),": ",t.jsx(P,{})]}),t.jsxs("li",{children:[t.jsx("b",{children:"Description"}),": ",x]}),i&&t.jsxs("li",{children:[t.jsx("b",{children:"End"}),": ",h(i).toLocaleTimeString()]}),s&&t.jsxs("li",{children:[t.jsx("b",{children:"Duration"}),":"," ",a?N(a):t.jsx(Y,{starttime:s})]})]})})})}function A(e){return t.jsx(j.Suspense,{fallback:"Loading...",children:t.jsx($,{...e})})}function U(e){const{providers:n,yamlNode:r,...o}=e;return q(r,o),t.jsx(A,{})}export{U as default};
@@ -1,4 +1,4 @@
1
- import{aR as N,r as I,bn as tr,bo as w,bp as mt,bq as ca,br as Xt,bs as bt,bt as G,bu as da,bv as pa,bw as va,bx as fa,j as P,g as ga,by as ma,O as ba,bz as ha,B as ht,bA as ya,bB as Da,q as xa}from"./index-4cf586ed.js";var Zt=N.createContext(null);function Ia(e){e()}var Qt=Ia,Sa=function(r){return Qt=r},Ca=function(){return Qt};function wa(){var e=Ca(),r=null,t=null;return{clear:function(){r=null,t=null},notify:function(){e(function(){for(var i=r;i;)i.callback(),i=i.next})},get:function(){for(var i=[],a=r;a;)i.push(a),a=a.next;return i},subscribe:function(i){var a=!0,o=t={callback:i,next:null,prev:t};return o.prev?o.prev.next=o:r=o,function(){!a||r===null||(a=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:r=o.next)}}}}var yt={notify:function(){},get:function(){return[]}};function _t(e,r){var t,n=yt;function i(s){return u(),n.subscribe(s)}function a(){n.notify()}function o(){p.onStateChange&&p.onStateChange()}function l(){return!!t}function u(){t||(t=r?r.addNestedSub(o):e.subscribe(o),n=wa())}function d(){t&&(t(),t=void 0,n.clear(),n=yt)}var p={addNestedSub:i,notifyNestedSubs:a,handleChangeWrapper:o,isSubscribed:l,trySubscribe:u,tryUnsubscribe:d,getListeners:function(){return n}};return p}var en=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?I.useLayoutEffect:I.useEffect;function Ea(e){var r=e.store,t=e.context,n=e.children,i=I.useMemo(function(){var l=_t(r);return{store:r,subscription:l}},[r]),a=I.useMemo(function(){return r.getState()},[r]);en(function(){var l=i.subscription;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),a!==r.getState()&&l.notifyNestedSubs(),function(){l.tryUnsubscribe(),l.onStateChange=null}},[i,a]);var o=t||Zt;return N.createElement(o.Provider,{value:i},n)}var rn={exports:{}},T={};/** @license React v17.0.2
1
+ import{aK as N,r as I,bx as tr,by as w,bz as mt,bA as ca,bB as Xt,bC as bt,bD as G,bE as da,bF as pa,bG as va,bH as fa,j as P,i as ga,aM as ma,O as ba,bI as ha,B as ht,bJ as ya,bK as Da,H as xa}from"./index-b3c0133a.js";var Zt=N.createContext(null);function Ia(e){e()}var Qt=Ia,Sa=function(r){return Qt=r},Ca=function(){return Qt};function wa(){var e=Ca(),r=null,t=null;return{clear:function(){r=null,t=null},notify:function(){e(function(){for(var i=r;i;)i.callback(),i=i.next})},get:function(){for(var i=[],a=r;a;)i.push(a),a=a.next;return i},subscribe:function(i){var a=!0,o=t={callback:i,next:null,prev:t};return o.prev?o.prev.next=o:r=o,function(){!a||r===null||(a=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:r=o.next)}}}}var yt={notify:function(){},get:function(){return[]}};function _t(e,r){var t,n=yt;function i(s){return u(),n.subscribe(s)}function a(){n.notify()}function o(){p.onStateChange&&p.onStateChange()}function l(){return!!t}function u(){t||(t=r?r.addNestedSub(o):e.subscribe(o),n=wa())}function d(){t&&(t(),t=void 0,n.clear(),n=yt)}var p={addNestedSub:i,notifyNestedSubs:a,handleChangeWrapper:o,isSubscribed:l,trySubscribe:u,tryUnsubscribe:d,getListeners:function(){return n}};return p}var en=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?I.useLayoutEffect:I.useEffect;function Ea(e){var r=e.store,t=e.context,n=e.children,i=I.useMemo(function(){var l=_t(r);return{store:r,subscription:l}},[r]),a=I.useMemo(function(){return r.getState()},[r]);en(function(){var l=i.subscription;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),a!==r.getState()&&l.notifyNestedSubs(),function(){l.tryUnsubscribe(),l.onStateChange=null}},[i,a]);var o=t||Zt;return N.createElement(o.Provider,{value:i},n)}var rn={exports:{}},T={};/** @license React v17.0.2
2
2
  * react-is.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -0,0 +1 @@
1
+ import{ai as l,X as i}from"./index-b3c0133a.js";function d(p){const{sz:t=null,sy:n=null,sampx:r=null,sampy:o=null,sampu:e=null,sampv:s=null}=p,a=new URL(`${l()}/tomo/move`);n&&a.searchParams.append("sy",n.toString()),t&&a.searchParams.append("sz",t.toString()),r&&a.searchParams.append("sampx",r.toString()),o&&a.searchParams.append("sampy",o.toString()),e&&a.searchParams.append("sampu",e.toString()),s&&a.searchParams.append("sampv",s.toString()),a.searchParams.append("relative","false");const c=new XMLHttpRequest;c.open("GET",a.href,!0),i.token&&c.setRequestHeader("Authorization",`Bearer ${i.token}`),c.send()}function u(p){const{datacollectionid:t,axisposition:n,deltabeta:r,filename:o}=p;if(t===void 0)return;const e=new URL(`${l()}/tomo/slice_reconstruction`);t!==void 0&&e.searchParams.append("datacollectionid",t.toString()),n!==void 0&&e.searchParams.append("axisposition",n.toString()),r!==void 0&&e.searchParams.append("deltabeta",r.toString()),o!==void 0&&e.searchParams.append("filename",o);const s=new XMLHttpRequest;s.open("GET",e.href,!0),i.token&&s.setRequestHeader("Authorization",`Bearer ${i.token}`),s.send()}export{u as a,d as r};