pyfast 4.12.0__cp36-abi3-macosx_10_13_x86_64.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 (279) hide show
  1. fast/README.md +41 -0
  2. fast/__init__.py +22 -0
  3. fast/bin/UFFviewer +0 -0
  4. fast/bin/fast_configuration.txt +14 -0
  5. fast/bin/runPipeline +0 -0
  6. fast/bin/systemCheck +0 -0
  7. fast/doc/bright-plotting-style.ini +66 -0
  8. fast/doc/dark-plotting-style.ini +66 -0
  9. fast/doc/fonts/UFL.txt +96 -0
  10. fast/doc/fonts/Ubuntu-Bold.ttf +0 -0
  11. fast/doc/fonts/Ubuntu-BoldItalic.ttf +0 -0
  12. fast/doc/fonts/Ubuntu-Italic.ttf +0 -0
  13. fast/doc/fonts/Ubuntu-Light.ttf +0 -0
  14. fast/doc/fonts/Ubuntu-LightItalic.ttf +0 -0
  15. fast/doc/fonts/Ubuntu-Medium.ttf +0 -0
  16. fast/doc/fonts/Ubuntu-MediumItalic.ttf +0 -0
  17. fast/doc/fonts/Ubuntu-Regular.ttf +0 -0
  18. fast/doc/fonts/UbuntuMono-Bold.ttf +0 -0
  19. fast/doc/fonts/UbuntuMono-BoldItalic.ttf +0 -0
  20. fast/doc/fonts/UbuntuMono-Italic.ttf +0 -0
  21. fast/doc/fonts/UbuntuMono-Regular.ttf +0 -0
  22. fast/doc/images/FAST_logo_square.png +0 -0
  23. fast/doc/images/fast_icon.ico +0 -0
  24. fast/doc/images/fast_icon.png +0 -0
  25. fast/entry_points.py +14 -0
  26. fast/fast.py +19961 -0
  27. fast/kernels/Algorithms/AirwaySegmentation/AirwaySegmentation.cl +85 -0
  28. fast/kernels/Algorithms/ApplyColormap/ApplyColormap.cl +146 -0
  29. fast/kernels/Algorithms/BinaryThresholding/BinaryThresholding2D.cl +61 -0
  30. fast/kernels/Algorithms/BinaryThresholding/BinaryThresholding3D.cl +61 -0
  31. fast/kernels/Algorithms/BlockMatching/BlockMatching.cl +257 -0
  32. fast/kernels/Algorithms/CenterlineExtraction/CenterlineExtraction.cl +153 -0
  33. fast/kernels/Algorithms/CoherentPointDrift/CoherentPointDrift.cl +0 -0
  34. fast/kernels/Algorithms/Color/ColorToGrayscale.cl +22 -0
  35. fast/kernels/Algorithms/Color/GrayscaleToColor.cl +19 -0
  36. fast/kernels/Algorithms/GaussianSmoothing/GaussianSmoothing2D.cl +35 -0
  37. fast/kernels/Algorithms/GaussianSmoothing/GaussianSmoothing3D.cl +75 -0
  38. fast/kernels/Algorithms/GradientVectorFlow/EulerGradientVectorFlow.cl +174 -0
  39. fast/kernels/Algorithms/GradientVectorFlow/MultigridGradientVectorFlow.cl +407 -0
  40. fast/kernels/Algorithms/HounsefieldConverter/HounsefieldConverter.cl +22 -0
  41. fast/kernels/Algorithms/ImageAdd/ImageAdd.cl +79 -0
  42. fast/kernels/Algorithms/ImageCaster/ImageCaster.cl +38 -0
  43. fast/kernels/Algorithms/ImageChannelConverter/ImageChannelConverter.cl +121 -0
  44. fast/kernels/Algorithms/ImageFlipper/ImageFlipper2D.cl +23 -0
  45. fast/kernels/Algorithms/ImageFlipper/ImageFlipper3D.cl +51 -0
  46. fast/kernels/Algorithms/ImageGradient/ImageGradient.cl +71 -0
  47. fast/kernels/Algorithms/ImageInverter/ImageInverter.cl +30 -0
  48. fast/kernels/Algorithms/ImageMultiply/ImageMultiply.cl +79 -0
  49. fast/kernels/Algorithms/ImagePatch/PatchStitcher2D.cl +22 -0
  50. fast/kernels/Algorithms/ImagePatch/PatchStitcher3D.cl +95 -0
  51. fast/kernels/Algorithms/ImageResampler/ImageResampler2D.cl +40 -0
  52. fast/kernels/Algorithms/ImageResampler/ImageResampler3D.cl +32 -0
  53. fast/kernels/Algorithms/ImageResizer/ImageResizer.cl +134 -0
  54. fast/kernels/Algorithms/ImageSharpening/ImageSharpening.cl +47 -0
  55. fast/kernels/Algorithms/ImageSlicer/ImageSlicer.cl +77 -0
  56. fast/kernels/Algorithms/ImageTransposer/ImageTransposer2D.cl +16 -0
  57. fast/kernels/Algorithms/ImageTransposer/ImageTransposer3D.cl +45 -0
  58. fast/kernels/Algorithms/IntensityClipping/IntensityClipping2D.cl +19 -0
  59. fast/kernels/Algorithms/IntensityClipping/IntensityClipping3D.cl +20 -0
  60. fast/kernels/Algorithms/IntensityNormalization/IntensityNormalization.cl +85 -0
  61. fast/kernels/Algorithms/IntensityNormalization/ZeroMeanUnitVariance.cl +76 -0
  62. fast/kernels/Algorithms/KalmanFilterModelSegmentation/AppearanceModels/RidgeEdge/RidgeEdgeModel.cl +81 -0
  63. fast/kernels/Algorithms/LabelModifier/LabelModifier.cl +20 -0
  64. fast/kernels/Algorithms/LaplacianOfGaussian/LaplacianOfGaussian2D.cl +27 -0
  65. fast/kernels/Algorithms/LevelSet/LevelSetSegmentation.cl +132 -0
  66. fast/kernels/Algorithms/LungSegmentation/LungSegmentation.cl +22 -0
  67. fast/kernels/Algorithms/MeshToSegmentation/MeshToSegmentation.cl +184 -0
  68. fast/kernels/Algorithms/Morphology/Dilation.cl +56 -0
  69. fast/kernels/Algorithms/Morphology/Erosion.cl +64 -0
  70. fast/kernels/Algorithms/NeuralNetwork/NeuralNetwork.cl +122 -0
  71. fast/kernels/Algorithms/NeuralNetwork/VertexTensorToSegmentation.cl +13 -0
  72. fast/kernels/Algorithms/NonLocalMeans/NonLocalMeans2D.cl +94 -0
  73. fast/kernels/Algorithms/SeededRegionGrowing/SeededRegionGrowing2D.cl +57 -0
  74. fast/kernels/Algorithms/SeededRegionGrowing/SeededRegionGrowing3D.cl +58 -0
  75. fast/kernels/Algorithms/Skeletonization/Skeletonization2D.cl +77 -0
  76. fast/kernels/Algorithms/SurfaceExtraction/SurfaceExtraction.cl +519 -0
  77. fast/kernels/Algorithms/SurfaceExtraction/SurfaceExtraction_no_3d_write.cl +739 -0
  78. fast/kernels/Algorithms/TemporalSmoothing/ImageMovingAverage.cl +66 -0
  79. fast/kernels/Algorithms/TemporalSmoothing/ImageWeightedMovingAverage.cl +74 -0
  80. fast/kernels/Algorithms/TissueSegmentation/TissueSegmentation.cl +18 -0
  81. fast/kernels/Algorithms/TubeSegmentationAndCenterlineExtraction/InverseGradientSegmentation.cl +203 -0
  82. fast/kernels/Algorithms/TubeSegmentationAndCenterlineExtraction/TubeSegmentationAndCenterlineExtraction.cl +566 -0
  83. fast/kernels/Algorithms/Ultrasound/EnvelopeAndLogCompressor.cl +45 -0
  84. fast/kernels/Algorithms/Ultrasound/ScanConverter.cl +76 -0
  85. fast/kernels/Algorithms/UltrasoundImageCropper/UltrasoundImageCropper.cl +31 -0
  86. fast/kernels/Algorithms/UltrasoundImageEnhancement/UltrasoundImageEnhancement.cl +27 -0
  87. fast/kernels/Algorithms/VectorMedianFilter/VectorMedianFilter.cl +31 -0
  88. fast/kernels/ImageFill.cl +30 -0
  89. fast/kernels/ImageMinMax.cl +196 -0
  90. fast/kernels/ImageSum.cl +170 -0
  91. fast/kernels/Tests/Algorithms/DoubleFilter.cl +7 -0
  92. fast/kernels/Visualization/BoundingBoxRenderer/BoundingBoxRenderer.frag +8 -0
  93. fast/kernels/Visualization/BoundingBoxRenderer/BoundingBoxRenderer.geom +69 -0
  94. fast/kernels/Visualization/BoundingBoxRenderer/BoundingBoxRenderer.vert +17 -0
  95. fast/kernels/Visualization/HeatmapRenderer/HeatmapRenderer.cl +51 -0
  96. fast/kernels/Visualization/ImagePyramidRenderer/ImagePyramidRenderer.frag +11 -0
  97. fast/kernels/Visualization/ImagePyramidRenderer/ImagePyramidRenderer.vert +15 -0
  98. fast/kernels/Visualization/ImageRenderer/ImageRenderer.vert +15 -0
  99. fast/kernels/Visualization/ImageRenderer/ImageRendererFLOAT.frag +18 -0
  100. fast/kernels/Visualization/ImageRenderer/ImageRendererINT.frag +18 -0
  101. fast/kernels/Visualization/ImageRenderer/ImageRendererUINT.frag +18 -0
  102. fast/kernels/Visualization/LineRenderer/LineRenderer.frag +8 -0
  103. fast/kernels/Visualization/LineRenderer/LineRenderer.geom +35 -0
  104. fast/kernels/Visualization/LineRenderer/LineRenderer.vert +20 -0
  105. fast/kernels/Visualization/LineRenderer/LineRenderer3D.frag +8 -0
  106. fast/kernels/Visualization/LineRenderer/LineRenderer3D.vert +20 -0
  107. fast/kernels/Visualization/LineRenderer/LineRendererJoints.frag +15 -0
  108. fast/kernels/Visualization/LineRenderer/LineRendererJoints.vert +24 -0
  109. fast/kernels/Visualization/SegmentationLabelRenderer/SegmentationLabelRenderer.frag +11 -0
  110. fast/kernels/Visualization/SegmentationLabelRenderer/SegmentationLabelRenderer.vert +16 -0
  111. fast/kernels/Visualization/SegmentationRenderer/SegmentationPyramidRenderer.frag +53 -0
  112. fast/kernels/Visualization/SegmentationRenderer/SegmentationRenderer.frag +52 -0
  113. fast/kernels/Visualization/SegmentationRenderer/SegmentationRenderer.vert +15 -0
  114. fast/kernels/Visualization/TextRenderer/TextRenderer.frag +11 -0
  115. fast/kernels/Visualization/TextRenderer/TextRenderer.vert +20 -0
  116. fast/kernels/Visualization/TriangleRenderer/TriangleRenderer.frag +49 -0
  117. fast/kernels/Visualization/TriangleRenderer/TriangleRenderer.vert +35 -0
  118. fast/kernels/Visualization/VectorFieldRenderer/VectorFieldColorRenderer.cl +30 -0
  119. fast/kernels/Visualization/VertexRenderer/VertexRenderer.frag +14 -0
  120. fast/kernels/Visualization/VertexRenderer/VertexRenderer.vert +23 -0
  121. fast/kernels/Visualization/View.cl +10 -0
  122. fast/kernels/Visualization/VolumeRenderer/AlphaBlendingVolumeRenderer.cl +211 -0
  123. fast/kernels/Visualization/VolumeRenderer/MaximumIntensityProjection.cl +139 -0
  124. fast/kernels/Visualization/VolumeRenderer/ThresholdVolumeRenderer.cl +178 -0
  125. fast/lib/_fast.abi3.so +0 -0
  126. fast/lib/libFAST.4.dylib +0 -0
  127. fast/lib/libInferenceEngineONNXRuntime.dylib +0 -0
  128. fast/lib/libInferenceEngineOpenVINO.dylib +0 -0
  129. fast/lib/libInferenceEngineTensorFlow.dylib +0 -0
  130. fast/lib/libJKQTCommonSharedLib_Release.4.0.0.dylib +0 -0
  131. fast/lib/libJKQTFastPlotterSharedLib_Release.4.0.0.dylib +0 -0
  132. fast/lib/libJKQTMathTextSharedLib_Release.4.0.0.dylib +0 -0
  133. fast/lib/libJKQTPlotterSharedLib_Release.4.0.0.dylib +0 -0
  134. fast/lib/libOpenIGTLink.3.dylib +0 -0
  135. fast/lib/libQt5Core.5.dylib +0 -0
  136. fast/lib/libQt5DBus.5.dylib +0 -0
  137. fast/lib/libQt5Gui.5.dylib +0 -0
  138. fast/lib/libQt5Multimedia.5.dylib +0 -0
  139. fast/lib/libQt5MultimediaWidgets.5.dylib +0 -0
  140. fast/lib/libQt5Network.5.dylib +0 -0
  141. fast/lib/libQt5OpenGL.5.dylib +0 -0
  142. fast/lib/libQt5PrintSupport.5.dylib +0 -0
  143. fast/lib/libQt5SerialPort.5.dylib +0 -0
  144. fast/lib/libQt5Svg.5.dylib +0 -0
  145. fast/lib/libQt5Widgets.5.dylib +0 -0
  146. fast/lib/libQt5Xml.5.dylib +0 -0
  147. fast/lib/libbrotlicommon.1.dylib +0 -0
  148. fast/lib/libbrotlidec.1.dylib +0 -0
  149. fast/lib/libbrotlienc.1.dylib +0 -0
  150. fast/lib/libdcmdata.17.dylib +0 -0
  151. fast/lib/libdcmimage.17.dylib +0 -0
  152. fast/lib/libdcmimgle.17.dylib +0 -0
  153. fast/lib/libdcmjpeg.17.dylib +0 -0
  154. fast/lib/libijg12.17.dylib +0 -0
  155. fast/lib/libijg12.dylib +0 -0
  156. fast/lib/libijg16.17.dylib +0 -0
  157. fast/lib/libijg16.dylib +0 -0
  158. fast/lib/libijg8.17.dylib +0 -0
  159. fast/lib/libijg8.dylib +0 -0
  160. fast/lib/libjxl.0.11.dylib +0 -0
  161. fast/lib/libjxl_cms.0.11.dylib +0 -0
  162. fast/lib/libjxl_threads.0.11.dylib +0 -0
  163. fast/lib/liboflog.17.dylib +0 -0
  164. fast/lib/libofstd.17.dylib +0 -0
  165. fast/lib/libonnxruntime.1.14.0.dylib +0 -0
  166. fast/lib/libonnxruntime.dylib +0 -0
  167. fast/lib/libopenslide.1.dylib +0 -0
  168. fast/lib/libopenvino.2230.dylib +0 -0
  169. fast/lib/libopenvino_auto_batch_plugin.so +0 -0
  170. fast/lib/libopenvino_auto_plugin.so +0 -0
  171. fast/lib/libopenvino_gapi_preproc.so +0 -0
  172. fast/lib/libopenvino_hetero_plugin.so +0 -0
  173. fast/lib/libopenvino_intel_cpu_plugin.so +0 -0
  174. fast/lib/libopenvino_ir_frontend.2230.dylib +0 -0
  175. fast/lib/libopenvino_onnx_frontend.2230.dylib +0 -0
  176. fast/lib/libopenvino_paddle_frontend.2230.dylib +0 -0
  177. fast/lib/libopenvino_tensorflow_frontend.2230.dylib +0 -0
  178. fast/lib/libtbb.dylib +0 -0
  179. fast/lib/libz.1.dylib +0 -0
  180. fast/lib/plugins.xml +16 -0
  181. fast/licenses/OpenIGTLink/LICENSE.txt +30 -0
  182. fast/licenses/OpenJPEG/LICENSE +39 -0
  183. fast/licenses/OpenSlide/COPYING.LESSER +504 -0
  184. fast/licenses/PCRE2/LICENCE.md +103 -0
  185. fast/licenses/cairo/COPYING +33 -0
  186. fast/licenses/cairo/COPYING-LGPL-2.1 +510 -0
  187. fast/licenses/cairo/COPYING-MPL-1.1 +470 -0
  188. fast/licenses/clarius/LICENSE +29 -0
  189. fast/licenses/dcmtk/COPYRIGHT +1034 -0
  190. fast/licenses/eigen/COPYING.APACHE +203 -0
  191. fast/licenses/eigen/COPYING.BSD +26 -0
  192. fast/licenses/eigen/COPYING.GPL +674 -0
  193. fast/licenses/eigen/COPYING.LGPL +502 -0
  194. fast/licenses/eigen/COPYING.MINPACK +51 -0
  195. fast/licenses/eigen/COPYING.MPL2 +373 -0
  196. fast/licenses/eigen/COPYING.README +18 -0
  197. fast/licenses/fast/LICENSE +25 -0
  198. fast/licenses/gdk-pixbuf/COPYING +502 -0
  199. fast/licenses/glib/COPYING +175 -0
  200. fast/licenses/hdf5/COPYING +106 -0
  201. fast/licenses/jkqtplotter/LICENSE +505 -0
  202. fast/licenses/jpegxl/LICENSE.brotli +19 -0
  203. fast/licenses/jpegxl/LICENSE.highway +201 -0
  204. fast/licenses/jpegxl/LICENSE.jpeg-xl +27 -0
  205. fast/licenses/jpegxl/LICENSE.skcms +29 -0
  206. fast/licenses/jpegxl/PATENTS +22 -0
  207. fast/licenses/libdicom/LICENSE +21 -0
  208. fast/licenses/libjpeg-turbo/LICENSE.md +135 -0
  209. fast/licenses/libjpeg-turbo/README.ijg +260 -0
  210. fast/licenses/libpng/LICENSE +134 -0
  211. fast/licenses/libtiff/LICENSE.md +23 -0
  212. fast/licenses/onnxruntime/LICENSE +21 -0
  213. fast/licenses/onnxruntime/Privacy.md +21 -0
  214. fast/licenses/onnxruntime/ThirdPartyNotices.txt +5786 -0
  215. fast/licenses/opencl/LICENSE +201 -0
  216. fast/licenses/openvino/Apache_license.txt +201 -0
  217. fast/licenses/openvino/EULA.htm +43 -0
  218. fast/licenses/openvino/EULA.rtf +61 -0
  219. fast/licenses/openvino/EULA.txt +163 -0
  220. fast/licenses/openvino/GNA SOFTWARE LICENSE AGREEMENT.txt +1 -0
  221. fast/licenses/openvino/Intel_Software_Development_Products.rtf +1217 -0
  222. fast/licenses/openvino/Intel_Software_Development_Products.txt +707 -0
  223. fast/licenses/openvino/LICENSE +201 -0
  224. fast/licenses/openvino/OpenVINOsupport.txt +12 -0
  225. fast/licenses/openvino/onednn_third-party-programs.txt +557 -0
  226. fast/licenses/openvino/readme.txt +60 -0
  227. fast/licenses/openvino/redist.txt +42 -0
  228. fast/licenses/openvino/runtime-third-party-programs.txt +1400 -0
  229. fast/licenses/openvino/tbb_third-party-programs.txt +230 -0
  230. fast/licenses/pixman/COPYING +42 -0
  231. fast/licenses/proxy-libintl/COPYING +482 -0
  232. fast/licenses/qt5/LICENSE.FDL +450 -0
  233. fast/licenses/qt5/LICENSE.GPL3-EXCEPT +704 -0
  234. fast/licenses/qt5/LICENSE.GPLv2 +292 -0
  235. fast/licenses/qt5/LICENSE.GPLv3 +686 -0
  236. fast/licenses/qt5/LICENSE.LGPLv21 +514 -0
  237. fast/licenses/qt5/LICENSE.LGPLv3 +175 -0
  238. fast/licenses/qt5/LICENSE.QT-LICENSE-AGREEMENT +1331 -0
  239. fast/licenses/semaphore/Semaphore_LICENSE.txt +17 -0
  240. fast/licenses/tensorflow/LICENSE +203 -0
  241. fast/licenses/tensorflow/THIRD_PARTY_TF_C_LICENSES +8963 -0
  242. fast/licenses/uthash/LICENSE +21 -0
  243. fast/licenses/zip/UNLICENSE +26 -0
  244. fast/licenses/zlib/README +115 -0
  245. fast/licenses/zlib-ng/LICENSE.md +19 -0
  246. fast/pipelines/uff_viewer/colormap_and_reject.fpl +26 -0
  247. fast/pipelines/uff_viewer/default.fpl +9 -0
  248. fast/pipelines/uff_viewer/non_local_means.fpl +34 -0
  249. fast/plugins/audio/libqtaudio_coreaudio.dylib +0 -0
  250. fast/plugins/bearer/libqgenericbearer.dylib +0 -0
  251. fast/plugins/generic/libqtuiotouchplugin.dylib +0 -0
  252. fast/plugins/iconengines/libqsvgicon.dylib +0 -0
  253. fast/plugins/imageformats/libqgif.dylib +0 -0
  254. fast/plugins/imageformats/libqicns.dylib +0 -0
  255. fast/plugins/imageformats/libqico.dylib +0 -0
  256. fast/plugins/imageformats/libqjpeg.dylib +0 -0
  257. fast/plugins/imageformats/libqmacheif.dylib +0 -0
  258. fast/plugins/imageformats/libqmacjp2.dylib +0 -0
  259. fast/plugins/imageformats/libqsvg.dylib +0 -0
  260. fast/plugins/imageformats/libqtga.dylib +0 -0
  261. fast/plugins/imageformats/libqtiff.dylib +0 -0
  262. fast/plugins/imageformats/libqwbmp.dylib +0 -0
  263. fast/plugins/imageformats/libqwebp.dylib +0 -0
  264. fast/plugins/mediaservice/libqavfcamera.dylib +0 -0
  265. fast/plugins/mediaservice/libqavfmediaplayer.dylib +0 -0
  266. fast/plugins/mediaservice/libqtmedia_audioengine.dylib +0 -0
  267. fast/plugins/platforms/libqcocoa.dylib +0 -0
  268. fast/plugins/platforms/libqminimal.dylib +0 -0
  269. fast/plugins/platforms/libqoffscreen.dylib +0 -0
  270. fast/plugins/platformthemes/libqxdgdesktopportal.dylib +0 -0
  271. fast/plugins/playlistformats/libqtmultimedia_m3u.dylib +0 -0
  272. fast/plugins/printsupport/libcocoaprintersupport.dylib +0 -0
  273. fast/plugins/sqldrivers/libqsqlite.dylib +0 -0
  274. fast/plugins/styles/libqmacstyle.dylib +0 -0
  275. pyfast-4.12.0.dist-info/METADATA +81 -0
  276. pyfast-4.12.0.dist-info/RECORD +279 -0
  277. pyfast-4.12.0.dist-info/WHEEL +5 -0
  278. pyfast-4.12.0.dist-info/entry_points.txt +5 -0
  279. pyfast-4.12.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,18 @@
1
+ #version 330 core
2
+ out vec4 FragColor;
3
+
4
+ in vec2 TexCoord;
5
+
6
+ uniform sampler2D ourTexture;
7
+ uniform float window;
8
+ uniform float level;
9
+ uniform float opacity;
10
+
11
+ void main()
12
+ {
13
+ vec4 color = vec4(texture(ourTexture, vec2(TexCoord.x, 1.0 - TexCoord.y)));
14
+ color.rgb = (color.rgb - level + window/2.0f) / window;
15
+ if(opacity >= 0.0)
16
+ color.w = opacity;
17
+ FragColor = clamp(color, 0.0f, 1.0f);
18
+ }
@@ -0,0 +1,18 @@
1
+ #version 330 core
2
+ out vec4 FragColor;
3
+
4
+ in vec2 TexCoord;
5
+
6
+ uniform isampler2D ourTexture;
7
+ uniform float window;
8
+ uniform float level;
9
+ uniform float opacity;
10
+
11
+ void main()
12
+ {
13
+ vec4 color = vec4(texture(ourTexture, vec2(TexCoord.x, 1.0 - TexCoord.y)));
14
+ color.rgb = (color.rgb - level + window/2.0f) / window;
15
+ if(opacity >= 0.0)
16
+ color.w = opacity;
17
+ FragColor = clamp(color, 0.0f, 1.0f);
18
+ }
@@ -0,0 +1,18 @@
1
+ #version 330 core
2
+ out vec4 FragColor;
3
+
4
+ in vec2 TexCoord;
5
+
6
+ uniform usampler2D ourTexture;
7
+ uniform float window;
8
+ uniform float level;
9
+ uniform float opacity;
10
+
11
+ void main() {
12
+ vec4 color = vec4(texture(ourTexture, vec2(TexCoord.x, 1.0 - TexCoord.y)));
13
+ color.rgb = (color.rgb - level + window/2.0f) / window; // Normalize RGB
14
+ color.a = color.a/255.0; // Normalize alpha
15
+ if(opacity >= 0.0)
16
+ color.w = opacity;
17
+ FragColor = clamp(color, 0.0f, 1.0f);
18
+ }
@@ -0,0 +1,8 @@
1
+ #version 330 core
2
+
3
+ in vec4 geomColor;
4
+ out vec4 FragColor;
5
+
6
+ void main() {
7
+ FragColor = geomColor;
8
+ }
@@ -0,0 +1,35 @@
1
+ #version 330
2
+
3
+ layout (lines) in; // now we can access 2 vertices
4
+ layout (triangle_strip, max_vertices = 4) out; // always (for now) producing 2 triangles (so 4 vertices)
5
+ in vec4 vertexColor[];
6
+ out vec4 geomColor;
7
+
8
+ uniform mat4 transform;
9
+ uniform mat4 viewTransform;
10
+ uniform mat4 perspectiveTransform;
11
+ uniform float thickness;
12
+ //uniform int viewportWidth;
13
+ //uniform int viewportHeight;
14
+
15
+ void main()
16
+ {
17
+ geomColor = vertexColor[0];
18
+ vec4 p1 = gl_in[0].gl_Position;
19
+ vec4 p2 = gl_in[1].gl_Position;
20
+
21
+ float size = (thickness/100.0)/(perspectiveTransform[0][0]/2.0); // percent to mm
22
+ vec2 dir = normalize((p2.xy - p1.xy));
23
+ vec4 offset = vec4(-dir.y, dir.x, 0, 0) * size * 0.5;
24
+
25
+ gl_Position = perspectiveTransform * viewTransform * transform * (p1 + offset);
26
+ EmitVertex();
27
+ gl_Position = perspectiveTransform * viewTransform * transform * (p1 - offset);
28
+ EmitVertex();
29
+ gl_Position = perspectiveTransform * viewTransform * transform * (p2 + offset);
30
+ EmitVertex();
31
+ gl_Position = perspectiveTransform * viewTransform * transform * (p2 - offset);
32
+ EmitVertex();
33
+
34
+ EndPrimitive();
35
+ }
@@ -0,0 +1,20 @@
1
+ #version 330 core
2
+ layout (location = 0) in vec3 in_position;
3
+ layout (location = 1) in vec3 in_color;
4
+
5
+ out vec4 vertexColor;
6
+
7
+ uniform mat4 transform;
8
+ uniform mat4 viewTransform;
9
+ uniform mat4 perspectiveTransform;
10
+ uniform bool useGlobalColor;
11
+ uniform vec3 globalColor;
12
+
13
+ void main() {
14
+ gl_Position = vec4(in_position, 1.0);
15
+ if(useGlobalColor) {
16
+ vertexColor = vec4(globalColor, 1.0);
17
+ } else {
18
+ vertexColor = vec4(in_color, 1.0);
19
+ }
20
+ }
@@ -0,0 +1,8 @@
1
+ #version 330 core
2
+
3
+ in vec4 vertexColor;
4
+ out vec4 FragColor;
5
+
6
+ void main() {
7
+ FragColor = vertexColor;
8
+ }
@@ -0,0 +1,20 @@
1
+ #version 330 core
2
+ layout (location = 0) in vec3 in_position;
3
+ layout (location = 1) in vec3 in_color;
4
+
5
+ out vec4 vertexColor;
6
+
7
+ uniform mat4 transform;
8
+ uniform mat4 viewTransform;
9
+ uniform mat4 perspectiveTransform;
10
+ uniform bool useGlobalColor;
11
+ uniform vec3 globalColor;
12
+
13
+ void main() {
14
+ gl_Position = perspectiveTransform * viewTransform * transform * vec4(in_position, 1.0);
15
+ if(useGlobalColor) {
16
+ vertexColor = vec4(globalColor, 1.0);
17
+ } else {
18
+ vertexColor = vec4(in_color, 1.0);
19
+ }
20
+ }
@@ -0,0 +1,15 @@
1
+ #version 330 core
2
+
3
+ out vec4 FragColor;
4
+ in vec4 vertex_color;
5
+
6
+ void main()
7
+ {
8
+ // Convert squares to circles
9
+ vec2 circCoord = gl_PointCoord - vec2(0.5, 0.5);
10
+ if(dot(circCoord, circCoord) > 0.25) { // x dot x = |x|*|x| = r^2, radius = 0.5, r^2=0.25
11
+ discard;
12
+ } else {
13
+ FragColor = vertex_color;
14
+ }
15
+ }
@@ -0,0 +1,24 @@
1
+ #version 330 core
2
+ layout (location = 0) in vec3 aPos;
3
+ layout (location = 1) in vec3 aColor;
4
+
5
+ out vec4 vertex_color;
6
+
7
+ uniform mat4 transform;
8
+ uniform mat4 viewTransform;
9
+ uniform mat4 perspectiveTransform;
10
+ uniform float pointSize;
11
+ uniform bool useGlobalColor;
12
+ uniform vec3 globalColor;
13
+ uniform int viewportWidth;
14
+
15
+ void main()
16
+ {
17
+ gl_Position = perspectiveTransform * viewTransform * transform * vec4(aPos, 1.0);
18
+ gl_PointSize = (pointSize/100.0)*viewportWidth; // gl_PointSize unit is in pixels
19
+ if(useGlobalColor) {
20
+ vertex_color = vec4(globalColor, 1.0);
21
+ } else {
22
+ vertex_color = vec4(aColor, 1.0);
23
+ }
24
+ }
@@ -0,0 +1,11 @@
1
+ #version 330 core
2
+ out vec4 FragColor;
3
+
4
+ in vec2 TexCoord;
5
+
6
+ uniform sampler2D ourTexture;
7
+
8
+ void main()
9
+ {
10
+ FragColor = texture(ourTexture, TexCoord);
11
+ }
@@ -0,0 +1,16 @@
1
+ #version 330 core
2
+ layout (location = 0) in vec3 aPos;
3
+ layout (location = 1) in vec2 aTexCoord;
4
+
5
+ out vec2 TexCoord;
6
+
7
+ uniform mat4 transform;
8
+ uniform mat4 viewTransform;
9
+ uniform mat4 perspectiveTransform;
10
+ uniform int positionType;
11
+
12
+ void main()
13
+ {
14
+ gl_Position = perspectiveTransform * viewTransform * transform * vec4(aPos, 1.0);
15
+ TexCoord = aTexCoord;
16
+ }
@@ -0,0 +1,53 @@
1
+ #version 330 core
2
+ layout (std140) uniform Colors {
3
+ vec4 color[256];
4
+ };
5
+ out vec4 FragColor;
6
+
7
+ in vec2 TexCoord;
8
+
9
+ // Using sampler2D here instead of usampler2d, due to texture compression
10
+ uniform sampler2D ourTexture;
11
+ uniform float opacity;
12
+ uniform float borderOpacity;
13
+ uniform int borderRadius;
14
+
15
+ void main()
16
+ {
17
+ uint in_label = uint(round(texture(ourTexture, vec2(TexCoord.x, TexCoord.y)).r*255)); // Texture compression is normalized
18
+ FragColor = vec4(0.0, 0.0, 0.0, 0.0);
19
+ vec2 size = textureSize(ourTexture, 0);
20
+ uint borderLabel = uint(0);
21
+
22
+ // Border check
23
+ bool isBorder = false;
24
+ if(borderRadius > 1 || borderOpacity != opacity) {
25
+ // Check neighbors
26
+ // If any neighbors have a different label, we are at the border
27
+ for(int a = -borderRadius; a <= borderRadius; ++a) {
28
+ for(int b = -borderRadius; b <= borderRadius; ++b) {
29
+ if(uint(round(texture(ourTexture, vec2(TexCoord.x + float(a)/size.x, (TexCoord.y + float(b)/size.y))).r*255)) != in_label){
30
+ if(borderRadius == 1 || length(vec2(a, b)) < borderRadius) {
31
+ if(in_label == uint(0)) {
32
+ // Outside
33
+ if(borderRadius > 1) {
34
+ borderLabel = uint(round(texture(ourTexture, vec2(TexCoord.x + float(a)/size.x, (TexCoord.y + float(b)/size.y))).r*255));
35
+ isBorder = true;
36
+ }
37
+ } else {
38
+ // Inside
39
+ isBorder = true;
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }
45
+ }
46
+
47
+ if((in_label > uint(0) && in_label < uint(256)) || isBorder) {
48
+ if(isBorder && in_label == uint(0))
49
+ in_label = borderLabel;
50
+ FragColor = color[in_label];
51
+ FragColor.a = isBorder ? borderOpacity : opacity;
52
+ }
53
+ }
@@ -0,0 +1,52 @@
1
+ #version 330 core
2
+ layout (std140) uniform Colors {
3
+ vec4 color[256];
4
+ };
5
+ out vec4 FragColor;
6
+
7
+ in vec2 TexCoord;
8
+
9
+ uniform usampler2D ourTexture;
10
+ uniform float opacity;
11
+ uniform float borderOpacity;
12
+ uniform int borderRadius;
13
+
14
+ void main()
15
+ {
16
+ uint in_label = texture(ourTexture, vec2(TexCoord.x, 1.0 - TexCoord.y)).r;
17
+ FragColor = vec4(0.0, 0.0, 0.0, 0.0);
18
+ vec2 size = textureSize(ourTexture, 0);
19
+ uint borderLabel = uint(0);
20
+
21
+ // Border check
22
+ bool isBorder = false;
23
+ if(borderRadius > 1 || borderOpacity != opacity) {
24
+ // Check neighbors
25
+ // If any neighbors have a different label, we are at the border
26
+ for(int a = -borderRadius; a <= borderRadius; ++a) {
27
+ for(int b = -borderRadius; b <= borderRadius; ++b) {
28
+ if(uint(texture(ourTexture, vec2(TexCoord.x + float(a)/size.x, 1.0 - (TexCoord.y + float(b)/size.y))).r) != in_label) {
29
+ if(borderRadius == 1 || length(vec2(a, b)) < borderRadius) {
30
+ if(in_label == uint(0)) {
31
+ // Outside
32
+ if(borderRadius > 1) {
33
+ borderLabel = uint(texture(ourTexture, vec2(TexCoord.x + float(a)/size.x, 1.0 - (TexCoord.y + float(b)/size.y))).r);
34
+ isBorder = true;
35
+ }
36
+ } else {
37
+ // Inside
38
+ isBorder = true;
39
+ }
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }
45
+
46
+ if((in_label > uint(0) && in_label < uint(256)) || isBorder) {
47
+ if(isBorder && in_label == uint(0))
48
+ in_label = borderLabel;
49
+ FragColor = color[in_label];
50
+ FragColor.a = isBorder ? borderOpacity : opacity;
51
+ }
52
+ }
@@ -0,0 +1,15 @@
1
+ #version 330 core
2
+ layout (location = 0) in vec3 aPos;
3
+ layout (location = 1) in vec2 aTexCoord;
4
+
5
+ out vec2 TexCoord;
6
+
7
+ uniform mat4 transform;
8
+ uniform mat4 viewTransform;
9
+ uniform mat4 perspectiveTransform;
10
+
11
+ void main()
12
+ {
13
+ gl_Position = perspectiveTransform * viewTransform * transform * vec4(aPos, 1.0);
14
+ TexCoord = aTexCoord;
15
+ }
@@ -0,0 +1,11 @@
1
+ #version 330 core
2
+ out vec4 FragColor;
3
+
4
+ in vec2 TexCoord;
5
+
6
+ uniform sampler2D ourTexture;
7
+
8
+ void main()
9
+ {
10
+ FragColor = texture(ourTexture, TexCoord);
11
+ }
@@ -0,0 +1,20 @@
1
+ #version 330 core
2
+ layout (location = 0) in vec3 aPos;
3
+ layout (location = 1) in vec2 aTexCoord;
4
+
5
+ out vec2 TexCoord;
6
+
7
+ uniform mat4 transform;
8
+ uniform mat4 viewTransform;
9
+ uniform mat4 perspectiveTransform;
10
+ uniform int positionType;
11
+
12
+ void main()
13
+ {
14
+ if(positionType == 2) {
15
+ gl_Position = perspectiveTransform * viewTransform * transform * vec4(aPos, 1.0);
16
+ } else {
17
+ gl_Position = transform * vec4(aPos, 1.0);
18
+ }
19
+ TexCoord = aTexCoord;
20
+ }
@@ -0,0 +1,49 @@
1
+ #version 330 core
2
+
3
+ in vec3 Normal;
4
+ in vec3 FragPos;
5
+ in vec3 LightPos;
6
+ in vec3 ViewPos;
7
+ in vec3 Color;
8
+
9
+ out vec4 FragColor;
10
+
11
+ uniform float opacity;
12
+ uniform bool mode2D;
13
+ uniform bool ignoreInvertedNormals;
14
+
15
+ void main()
16
+ {
17
+ if(mode2D) {
18
+ FragColor = vec4(Color, opacity);
19
+ } else {
20
+ vec3 objectColor = Color;
21
+ vec3 lightColor = vec3(0.7, 0.7, 0.7);
22
+ vec3 ambientColor = vec3(0.2, 0.2, 0.2);
23
+ vec3 specularColor = vec3(1.0, 1.0, 1.0);
24
+ float shininess = 16;
25
+
26
+ // ambient
27
+ vec3 ambient = lightColor * ambientColor;
28
+
29
+ // diffuse
30
+ vec3 norm = normalize(Normal);
31
+ vec3 lightDir = normalize(LightPos - FragPos);
32
+ float diff;
33
+ if(ignoreInvertedNormals) {
34
+ diff = abs(dot(norm, lightDir));
35
+ } else {
36
+ diff = max(dot(norm, lightDir), 0.0);
37
+ }
38
+ vec3 diffuse = lightColor * (diff * objectColor);
39
+
40
+ // specular
41
+ vec3 viewDir = normalize(ViewPos - FragPos);
42
+ vec3 reflectDir = reflect(-lightDir, norm);
43
+ float spec = pow(max(dot(viewDir, reflectDir), 0.0), shininess);
44
+ vec3 specular = lightColor * (spec * specularColor);
45
+
46
+ vec3 result = ambient + diffuse + specular;
47
+ FragColor = vec4(result, opacity);
48
+ }
49
+ }
@@ -0,0 +1,35 @@
1
+ #version 330 core
2
+ layout (location = 0) in vec3 aPos;
3
+ layout (location = 1) in vec3 aNormal;
4
+ layout (location = 2) in vec3 aColor;
5
+
6
+ out vec3 Normal;
7
+ out vec3 FragPos;
8
+ out vec3 LightPos;
9
+ out vec3 ViewPos;
10
+ out vec3 Color;
11
+
12
+ uniform mat4 transform;
13
+ uniform mat4 viewTransform;
14
+ uniform mat4 perspectiveTransform;
15
+ uniform bool use_normals;
16
+ uniform bool useGlobalColor;
17
+ uniform vec3 globalColor;
18
+
19
+ void main()
20
+ {
21
+ gl_Position = perspectiveTransform * viewTransform * transform * vec4(aPos, 1.0);
22
+ if(use_normals) {
23
+ Normal = mat3(transpose(inverse(transform))) * aNormal;
24
+ } else {
25
+ Normal = vec3(1,0,0);
26
+ }
27
+ FragPos = vec3(transform * vec4(aPos, 1.0));
28
+ LightPos = vec3(inverse(viewTransform) * vec4(0.0, 0.0, 0.0, 1.0));
29
+ ViewPos = vec3(inverse(viewTransform) * vec4(0.0, 0.0, 0.0, 1.0));
30
+ if(useGlobalColor) {
31
+ Color = globalColor;
32
+ } else {
33
+ Color = aColor;
34
+ }
35
+ }
@@ -0,0 +1,30 @@
1
+ __constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST;
2
+
3
+ float3 hueToRGB(float H) {
4
+ float R = fabs(H * 6.0f - 3.0f) - 1;
5
+ float G = 2 - fabs(H * 6 - 2);
6
+ float B = 2 - fabs(H * 6 - 4);
7
+ return clamp((float3)(R, G, B), 0.0f, 1.0f);
8
+ }
9
+
10
+ __kernel void renderToTexture(
11
+ __read_only image2d_t input,
12
+ __write_only image2d_t output,
13
+ __private float maxOpacity,
14
+ __private float maxVectorMagnitude
15
+ ) {
16
+ const int2 position = {get_global_id(0), get_global_id(1)};
17
+
18
+ const float2 vector = read_imagef(input, sampler, position).xy;
19
+
20
+ // Calculate angle of vector
21
+ const float angle = (1.0f + atan2(vector.y, vector.x) / 3.141592f) / 2.0f; // mapping -pi,pi to 0,1
22
+
23
+ // Use angle as hue and then convert to RGB
24
+ const float3 color = hueToRGB(angle);
25
+
26
+ // Use vector magnitude as opacity
27
+ const float opacity = clamp(length(vector)/maxVectorMagnitude, 0.0f, maxOpacity);
28
+
29
+ write_imagef(output, position, (float4)(color.x, color.y, color.z, opacity));
30
+ }
@@ -0,0 +1,14 @@
1
+ #version 330 core
2
+
3
+ out vec4 FragColor;
4
+ in vec4 vertex_color;
5
+
6
+ void main()
7
+ {
8
+ vec2 circCoord = gl_PointCoord - vec2(0.5, 0.5);
9
+ if(dot(circCoord, circCoord) > 0.25) {
10
+ discard;
11
+ } else {
12
+ FragColor = vertex_color;
13
+ }
14
+ }
@@ -0,0 +1,23 @@
1
+ #version 330 core
2
+ layout (location = 0) in vec3 aPos;
3
+ layout (location = 1) in vec3 aColor;
4
+
5
+ out vec4 vertex_color;
6
+
7
+ uniform mat4 transform;
8
+ uniform mat4 viewTransform;
9
+ uniform mat4 perspectiveTransform;
10
+ uniform float pointSize;
11
+ uniform bool useGlobalColor;
12
+ uniform vec3 globalColor;
13
+
14
+ void main()
15
+ {
16
+ gl_PointSize = pointSize;
17
+ gl_Position = perspectiveTransform * viewTransform * transform * vec4(aPos, 1.0);
18
+ if(useGlobalColor) {
19
+ vertex_color = vec4(globalColor, 1.0);
20
+ } else {
21
+ vertex_color = vec4(aColor, 1.0);
22
+ }
23
+ }
@@ -0,0 +1,10 @@
1
+
2
+ __kernel void initializePBO(
3
+ __global float* PBO,
4
+ __private float red,
5
+ __private float green,
6
+ __private float blue
7
+ ) {
8
+ const float4 value = {red, green, blue, 1.0};
9
+ vstore4(value, get_global_id(0), PBO);
10
+ }