pyfast 4.12.0__cp36-abi3-win_amd64.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.
- fast/README.md +41 -0
- fast/__init__.py +22 -0
- fast/bin/DirectML.dll +0 -0
- fast/bin/FAST.dll +0 -0
- fast/bin/InferenceEngineONNXRuntime.dll +0 -0
- fast/bin/InferenceEngineOpenVINO.dll +0 -0
- fast/bin/InferenceEngineTensorFlow.dll +0 -0
- fast/bin/InferenceEngineTensorRT.dll +0 -0
- fast/bin/JKQTCommonSharedLib_Release.dll +0 -0
- fast/bin/JKQTFastPlotterSharedLib_Release.dll +0 -0
- fast/bin/JKQTMathTextSharedLib_Release.dll +0 -0
- fast/bin/JKQTPlotterSharedLib_Release.dll +0 -0
- fast/bin/OpenCL.dll +0 -0
- fast/bin/OpenIGTLink.dll +0 -0
- fast/bin/Qt5Concurrent.dll +0 -0
- fast/bin/Qt5Core.dll +0 -0
- fast/bin/Qt5DBus.dll +0 -0
- fast/bin/Qt5Gui.dll +0 -0
- fast/bin/Qt5Multimedia.dll +0 -0
- fast/bin/Qt5MultimediaWidgets.dll +0 -0
- fast/bin/Qt5Network.dll +0 -0
- fast/bin/Qt5OpenGL.dll +0 -0
- fast/bin/Qt5PrintSupport.dll +0 -0
- fast/bin/Qt5SerialPort.dll +0 -0
- fast/bin/Qt5Sql.dll +0 -0
- fast/bin/Qt5Svg.dll +0 -0
- fast/bin/Qt5Test.dll +0 -0
- fast/bin/Qt5Widgets.dll +0 -0
- fast/bin/Qt5Xml.dll +0 -0
- fast/bin/UFFviewer.exe +0 -0
- fast/bin/_fast.pyd +0 -0
- fast/bin/brotlicommon.dll +0 -0
- fast/bin/brotlidec.dll +0 -0
- fast/bin/brotlienc.dll +0 -0
- fast/bin/cache.json +114134 -0
- fast/bin/dcmdata.dll +0 -0
- fast/bin/dcmimage.dll +0 -0
- fast/bin/dcmimgle.dll +0 -0
- fast/bin/dcmjpeg.dll +0 -0
- fast/bin/fast_configuration.txt +14 -0
- fast/bin/gna.dll +0 -0
- fast/bin/ijg12.dll +0 -0
- fast/bin/ijg16.dll +0 -0
- fast/bin/ijg8.dll +0 -0
- fast/bin/jxl.dll +0 -0
- fast/bin/jxl_cms.dll +0 -0
- fast/bin/jxl_threads.dll +0 -0
- fast/bin/libcrypto-1_1-x64.dll +0 -0
- fast/bin/libjpeg.dll +0 -0
- fast/bin/libopenslide-1.dll +0 -0
- fast/bin/libssl-1_1-x64.dll +0 -0
- fast/bin/oflog.dll +0 -0
- fast/bin/ofstd.dll +0 -0
- fast/bin/onnxruntime.dll +0 -0
- fast/bin/onnxruntime_providers_shared.dll +0 -0
- fast/bin/openvino.dll +0 -0
- fast/bin/openvino_auto_batch_plugin.dll +0 -0
- fast/bin/openvino_auto_plugin.dll +0 -0
- fast/bin/openvino_c.dll +0 -0
- fast/bin/openvino_gapi_preproc.dll +0 -0
- fast/bin/openvino_hetero_plugin.dll +0 -0
- fast/bin/openvino_intel_cpu_plugin.dll +0 -0
- fast/bin/openvino_intel_gna_plugin.dll +0 -0
- fast/bin/openvino_intel_gpu_plugin.dll +0 -0
- fast/bin/openvino_ir_frontend.dll +0 -0
- fast/bin/openvino_onnx_frontend.dll +0 -0
- fast/bin/openvino_paddle_frontend.dll +0 -0
- fast/bin/plugins.xml +24 -0
- fast/bin/realsense2.dll +0 -0
- fast/bin/runPipeline.exe +0 -0
- fast/bin/systemCheck.exe +0 -0
- fast/bin/tbb.dll +0 -0
- fast/bin/tbb_preview.dll +0 -0
- fast/bin/tbbbind.dll +0 -0
- fast/bin/tbbmalloc.dll +0 -0
- fast/bin/tbbmalloc_proxy.dll +0 -0
- fast/bin/tiff.dll +0 -0
- fast/bin/zlib.dll +0 -0
- fast/doc/bright-plotting-style.ini +66 -0
- fast/doc/dark-plotting-style.ini +66 -0
- fast/doc/fonts/UFL.txt +96 -0
- fast/doc/fonts/Ubuntu-Bold.ttf +0 -0
- fast/doc/fonts/Ubuntu-BoldItalic.ttf +0 -0
- fast/doc/fonts/Ubuntu-Italic.ttf +0 -0
- fast/doc/fonts/Ubuntu-Light.ttf +0 -0
- fast/doc/fonts/Ubuntu-LightItalic.ttf +0 -0
- fast/doc/fonts/Ubuntu-Medium.ttf +0 -0
- fast/doc/fonts/Ubuntu-MediumItalic.ttf +0 -0
- fast/doc/fonts/Ubuntu-Regular.ttf +0 -0
- fast/doc/fonts/UbuntuMono-Bold.ttf +0 -0
- fast/doc/fonts/UbuntuMono-BoldItalic.ttf +0 -0
- fast/doc/fonts/UbuntuMono-Italic.ttf +0 -0
- fast/doc/fonts/UbuntuMono-Regular.ttf +0 -0
- fast/doc/images/FAST_logo_square.png +0 -0
- fast/doc/images/fast_icon.ico +0 -0
- fast/doc/images/fast_icon.png +0 -0
- fast/entry_points.py +14 -0
- fast/fast.py +20057 -0
- fast/kernels/Algorithms/AirwaySegmentation/AirwaySegmentation.cl +85 -0
- fast/kernels/Algorithms/ApplyColormap/ApplyColormap.cl +146 -0
- fast/kernels/Algorithms/BinaryThresholding/BinaryThresholding2D.cl +61 -0
- fast/kernels/Algorithms/BinaryThresholding/BinaryThresholding3D.cl +61 -0
- fast/kernels/Algorithms/BlockMatching/BlockMatching.cl +257 -0
- fast/kernels/Algorithms/CenterlineExtraction/CenterlineExtraction.cl +153 -0
- fast/kernels/Algorithms/CoherentPointDrift/CoherentPointDrift.cl +0 -0
- fast/kernels/Algorithms/Color/ColorToGrayscale.cl +22 -0
- fast/kernels/Algorithms/Color/GrayscaleToColor.cl +19 -0
- fast/kernels/Algorithms/GaussianSmoothing/GaussianSmoothing2D.cl +35 -0
- fast/kernels/Algorithms/GaussianSmoothing/GaussianSmoothing3D.cl +75 -0
- fast/kernels/Algorithms/GradientVectorFlow/EulerGradientVectorFlow.cl +174 -0
- fast/kernels/Algorithms/GradientVectorFlow/MultigridGradientVectorFlow.cl +407 -0
- fast/kernels/Algorithms/HounsefieldConverter/HounsefieldConverter.cl +22 -0
- fast/kernels/Algorithms/ImageAdd/ImageAdd.cl +79 -0
- fast/kernels/Algorithms/ImageCaster/ImageCaster.cl +38 -0
- fast/kernels/Algorithms/ImageChannelConverter/ImageChannelConverter.cl +121 -0
- fast/kernels/Algorithms/ImageFlipper/ImageFlipper2D.cl +23 -0
- fast/kernels/Algorithms/ImageFlipper/ImageFlipper3D.cl +51 -0
- fast/kernels/Algorithms/ImageGradient/ImageGradient.cl +71 -0
- fast/kernels/Algorithms/ImageInverter/ImageInverter.cl +30 -0
- fast/kernels/Algorithms/ImageMultiply/ImageMultiply.cl +79 -0
- fast/kernels/Algorithms/ImagePatch/PatchStitcher2D.cl +22 -0
- fast/kernels/Algorithms/ImagePatch/PatchStitcher3D.cl +95 -0
- fast/kernels/Algorithms/ImageResampler/ImageResampler2D.cl +40 -0
- fast/kernels/Algorithms/ImageResampler/ImageResampler3D.cl +32 -0
- fast/kernels/Algorithms/ImageResizer/ImageResizer.cl +134 -0
- fast/kernels/Algorithms/ImageSharpening/ImageSharpening.cl +47 -0
- fast/kernels/Algorithms/ImageSlicer/ImageSlicer.cl +77 -0
- fast/kernels/Algorithms/ImageTransposer/ImageTransposer2D.cl +16 -0
- fast/kernels/Algorithms/ImageTransposer/ImageTransposer3D.cl +45 -0
- fast/kernels/Algorithms/IntensityClipping/IntensityClipping2D.cl +19 -0
- fast/kernels/Algorithms/IntensityClipping/IntensityClipping3D.cl +20 -0
- fast/kernels/Algorithms/IntensityNormalization/IntensityNormalization.cl +85 -0
- fast/kernels/Algorithms/IntensityNormalization/ZeroMeanUnitVariance.cl +76 -0
- fast/kernels/Algorithms/KalmanFilterModelSegmentation/AppearanceModels/RidgeEdge/RidgeEdgeModel.cl +81 -0
- fast/kernels/Algorithms/LabelModifier/LabelModifier.cl +20 -0
- fast/kernels/Algorithms/LaplacianOfGaussian/LaplacianOfGaussian2D.cl +27 -0
- fast/kernels/Algorithms/LevelSet/LevelSetSegmentation.cl +132 -0
- fast/kernels/Algorithms/LungSegmentation/LungSegmentation.cl +22 -0
- fast/kernels/Algorithms/MeshToSegmentation/MeshToSegmentation.cl +184 -0
- fast/kernels/Algorithms/Morphology/Dilation.cl +56 -0
- fast/kernels/Algorithms/Morphology/Erosion.cl +64 -0
- fast/kernels/Algorithms/NeuralNetwork/NeuralNetwork.cl +122 -0
- fast/kernels/Algorithms/NeuralNetwork/VertexTensorToSegmentation.cl +13 -0
- fast/kernels/Algorithms/NonLocalMeans/NonLocalMeans2D.cl +94 -0
- fast/kernels/Algorithms/SeededRegionGrowing/SeededRegionGrowing2D.cl +57 -0
- fast/kernels/Algorithms/SeededRegionGrowing/SeededRegionGrowing3D.cl +58 -0
- fast/kernels/Algorithms/Skeletonization/Skeletonization2D.cl +77 -0
- fast/kernels/Algorithms/SurfaceExtraction/SurfaceExtraction.cl +519 -0
- fast/kernels/Algorithms/SurfaceExtraction/SurfaceExtraction_no_3d_write.cl +739 -0
- fast/kernels/Algorithms/TemporalSmoothing/ImageMovingAverage.cl +66 -0
- fast/kernels/Algorithms/TemporalSmoothing/ImageWeightedMovingAverage.cl +74 -0
- fast/kernels/Algorithms/TissueSegmentation/TissueSegmentation.cl +18 -0
- fast/kernels/Algorithms/TubeSegmentationAndCenterlineExtraction/InverseGradientSegmentation.cl +203 -0
- fast/kernels/Algorithms/TubeSegmentationAndCenterlineExtraction/TubeSegmentationAndCenterlineExtraction.cl +566 -0
- fast/kernels/Algorithms/Ultrasound/EnvelopeAndLogCompressor.cl +45 -0
- fast/kernels/Algorithms/Ultrasound/ScanConverter.cl +76 -0
- fast/kernels/Algorithms/UltrasoundImageCropper/UltrasoundImageCropper.cl +31 -0
- fast/kernels/Algorithms/UltrasoundImageEnhancement/UltrasoundImageEnhancement.cl +27 -0
- fast/kernels/Algorithms/VectorMedianFilter/VectorMedianFilter.cl +31 -0
- fast/kernels/ImageFill.cl +30 -0
- fast/kernels/ImageMinMax.cl +196 -0
- fast/kernels/ImageSum.cl +170 -0
- fast/kernels/Tests/Algorithms/DoubleFilter.cl +7 -0
- fast/kernels/Visualization/BoundingBoxRenderer/BoundingBoxRenderer.frag +8 -0
- fast/kernels/Visualization/BoundingBoxRenderer/BoundingBoxRenderer.geom +69 -0
- fast/kernels/Visualization/BoundingBoxRenderer/BoundingBoxRenderer.vert +17 -0
- fast/kernels/Visualization/HeatmapRenderer/HeatmapRenderer.cl +51 -0
- fast/kernels/Visualization/ImagePyramidRenderer/ImagePyramidRenderer.frag +11 -0
- fast/kernels/Visualization/ImagePyramidRenderer/ImagePyramidRenderer.vert +15 -0
- fast/kernels/Visualization/ImageRenderer/ImageRenderer.vert +15 -0
- fast/kernels/Visualization/ImageRenderer/ImageRendererFLOAT.frag +18 -0
- fast/kernels/Visualization/ImageRenderer/ImageRendererINT.frag +18 -0
- fast/kernels/Visualization/ImageRenderer/ImageRendererUINT.frag +18 -0
- fast/kernels/Visualization/LineRenderer/LineRenderer.frag +8 -0
- fast/kernels/Visualization/LineRenderer/LineRenderer.geom +35 -0
- fast/kernels/Visualization/LineRenderer/LineRenderer.vert +20 -0
- fast/kernels/Visualization/LineRenderer/LineRenderer3D.frag +8 -0
- fast/kernels/Visualization/LineRenderer/LineRenderer3D.vert +20 -0
- fast/kernels/Visualization/LineRenderer/LineRendererJoints.frag +15 -0
- fast/kernels/Visualization/LineRenderer/LineRendererJoints.vert +24 -0
- fast/kernels/Visualization/SegmentationLabelRenderer/SegmentationLabelRenderer.frag +11 -0
- fast/kernels/Visualization/SegmentationLabelRenderer/SegmentationLabelRenderer.vert +16 -0
- fast/kernels/Visualization/SegmentationRenderer/SegmentationPyramidRenderer.frag +53 -0
- fast/kernels/Visualization/SegmentationRenderer/SegmentationRenderer.frag +52 -0
- fast/kernels/Visualization/SegmentationRenderer/SegmentationRenderer.vert +15 -0
- fast/kernels/Visualization/TextRenderer/TextRenderer.frag +11 -0
- fast/kernels/Visualization/TextRenderer/TextRenderer.vert +20 -0
- fast/kernels/Visualization/TriangleRenderer/TriangleRenderer.frag +49 -0
- fast/kernels/Visualization/TriangleRenderer/TriangleRenderer.vert +35 -0
- fast/kernels/Visualization/VectorFieldRenderer/VectorFieldColorRenderer.cl +30 -0
- fast/kernels/Visualization/VertexRenderer/VertexRenderer.frag +14 -0
- fast/kernels/Visualization/VertexRenderer/VertexRenderer.vert +23 -0
- fast/kernels/Visualization/View.cl +10 -0
- fast/kernels/Visualization/VolumeRenderer/AlphaBlendingVolumeRenderer.cl +211 -0
- fast/kernels/Visualization/VolumeRenderer/MaximumIntensityProjection.cl +139 -0
- fast/kernels/Visualization/VolumeRenderer/ThresholdVolumeRenderer.cl +178 -0
- fast/licenses/LICENSE +203 -0
- fast/licenses/MSVC/MSVC_redis_files_license.txt +96 -0
- fast/licenses/OpenIGTLink/LICENSE.txt +30 -0
- fast/licenses/OpenJPEG/LICENSE +39 -0
- fast/licenses/OpenSlide/COPYING.LESSER +504 -0
- fast/licenses/PCRE2/LICENCE.md +103 -0
- fast/licenses/SQLite/PUBLIC-DOMAIN.txt +9 -0
- fast/licenses/THIRD_PARTY_TF_C_LICENSES +7955 -0
- fast/licenses/cairo/COPYING +33 -0
- fast/licenses/cairo/COPYING-LGPL-2.1 +510 -0
- fast/licenses/cairo/COPYING-MPL-1.1 +470 -0
- fast/licenses/clarius/LICENSE +29 -0
- fast/licenses/dcmtk/COPYRIGHT +1034 -0
- fast/licenses/directml/LICENSE-CODE.txt +21 -0
- fast/licenses/directml/LICENSE.txt +48 -0
- fast/licenses/directml/ThirdPartyNotices.txt +103 -0
- fast/licenses/eigen/COPYING.APACHE +203 -0
- fast/licenses/eigen/COPYING.BSD +26 -0
- fast/licenses/eigen/COPYING.GPL +674 -0
- fast/licenses/eigen/COPYING.LGPL +502 -0
- fast/licenses/eigen/COPYING.MINPACK +51 -0
- fast/licenses/eigen/COPYING.MPL2 +373 -0
- fast/licenses/eigen/COPYING.README +18 -0
- fast/licenses/fast/LICENSE +25 -0
- fast/licenses/gdk-pixbuf/COPYING +502 -0
- fast/licenses/glib/COPYING +175 -0
- fast/licenses/hdf5/COPYING +106 -0
- fast/licenses/jkqtplotter/LICENSE +505 -0
- fast/licenses/jpegxl/LICENSE.brotli +19 -0
- fast/licenses/jpegxl/LICENSE.highway +201 -0
- fast/licenses/jpegxl/LICENSE.jpeg-xl +27 -0
- fast/licenses/jpegxl/LICENSE.skcms +29 -0
- fast/licenses/jpegxl/PATENTS +22 -0
- fast/licenses/libdicom/LICENSE +21 -0
- fast/licenses/libffi/LICENSE +21 -0
- fast/licenses/libjpeg-turbo/LICENSE.md +135 -0
- fast/licenses/libjpeg-turbo/README.ijg +260 -0
- fast/licenses/libpng/LICENSE +134 -0
- fast/licenses/libtiff/LICENSE.md +23 -0
- fast/licenses/libxml2/Copyright +24 -0
- fast/licenses/onnxruntime/LICENSE +21 -0
- fast/licenses/onnxruntime/Privacy.md +21 -0
- fast/licenses/onnxruntime/ThirdPartyNotices.txt +6156 -0
- fast/licenses/opencl/LICENSE +201 -0
- fast/licenses/openssl/LICENSE.txt +125 -0
- fast/licenses/openvino/Apache_license.txt +201 -0
- fast/licenses/openvino/EULA.htm +43 -0
- fast/licenses/openvino/EULA.rtf +61 -0
- fast/licenses/openvino/EULA.txt +163 -0
- fast/licenses/openvino/GNA SOFTWARE LICENSE AGREEMENT.txt +1 -0
- fast/licenses/openvino/Intel_Software_Development_Products.rtf +1217 -0
- fast/licenses/openvino/Intel_Software_Development_Products.txt +707 -0
- fast/licenses/openvino/LICENSE +201 -0
- fast/licenses/openvino/OpenVINOsupport.txt +12 -0
- fast/licenses/openvino/onednn_third-party-programs.txt +557 -0
- fast/licenses/openvino/readme.txt +60 -0
- fast/licenses/openvino/redist.txt +42 -0
- fast/licenses/openvino/runtime-third-party-programs.txt +1400 -0
- fast/licenses/openvino/tbb_third-party-programs.txt +230 -0
- fast/licenses/pixman/COPYING +42 -0
- fast/licenses/proxy-libintl/COPYING +482 -0
- fast/licenses/qt5/LICENSE.FDL +450 -0
- fast/licenses/qt5/LICENSE.GPL3-EXCEPT +704 -0
- fast/licenses/qt5/LICENSE.GPLv2 +292 -0
- fast/licenses/qt5/LICENSE.GPLv3 +686 -0
- fast/licenses/qt5/LICENSE.LGPLv21 +514 -0
- fast/licenses/qt5/LICENSE.LGPLv3 +175 -0
- fast/licenses/qt5/LICENSE.QT-LICENSE-AGREEMENT +1331 -0
- fast/licenses/realsense/LICENSE +202 -0
- fast/licenses/realsense/NOTICE +937 -0
- fast/licenses/semaphore/Semaphore_LICENSE.txt +17 -0
- fast/licenses/tiff/COPYRIGHT +21 -0
- fast/licenses/uthash/LICENSE +21 -0
- fast/licenses/zip/UNLICENSE +26 -0
- fast/licenses/zlib/README +115 -0
- fast/licenses/zlib-ng/LICENSE.md +19 -0
- fast/pipelines/uff_viewer/colormap_and_reject.fpl +26 -0
- fast/pipelines/uff_viewer/default.fpl +9 -0
- fast/pipelines/uff_viewer/non_local_means.fpl +34 -0
- fast/plugins/audio/qtaudio_wasapi.dll +0 -0
- fast/plugins/audio/qtaudio_windows.dll +0 -0
- fast/plugins/bearer/qgenericbearer.dll +0 -0
- fast/plugins/generic/qtuiotouchplugin.dll +0 -0
- fast/plugins/iconengines/qsvgicon.dll +0 -0
- fast/plugins/imageformats/qgif.dll +0 -0
- fast/plugins/imageformats/qicns.dll +0 -0
- fast/plugins/imageformats/qico.dll +0 -0
- fast/plugins/imageformats/qjpeg.dll +0 -0
- fast/plugins/imageformats/qsvg.dll +0 -0
- fast/plugins/imageformats/qtga.dll +0 -0
- fast/plugins/imageformats/qtiff.dll +0 -0
- fast/plugins/imageformats/qwbmp.dll +0 -0
- fast/plugins/imageformats/qwebp.dll +0 -0
- fast/plugins/mediaservice/dsengine.dll +0 -0
- fast/plugins/mediaservice/qtmedia_audioengine.dll +0 -0
- fast/plugins/mediaservice/wmfengine.dll +0 -0
- fast/plugins/platforms/qdirect2d.dll +0 -0
- fast/plugins/platforms/qminimal.dll +0 -0
- fast/plugins/platforms/qoffscreen.dll +0 -0
- fast/plugins/platforms/qwindows.dll +0 -0
- fast/plugins/platformthemes/qxdgdesktopportal.dll +0 -0
- fast/plugins/playlistformats/qtmultimedia_m3u.dll +0 -0
- fast/plugins/printsupport/windowsprintersupport.dll +0 -0
- fast/plugins/sqldrivers/qsqlite.dll +0 -0
- fast/plugins/sqldrivers/qsqlodbc.dll +0 -0
- fast/plugins/styles/qwindowsvistastyle.dll +0 -0
- pyfast-4.12.0.dist-info/METADATA +81 -0
- pyfast-4.12.0.dist-info/RECORD +307 -0
- pyfast-4.12.0.dist-info/WHEEL +5 -0
- pyfast-4.12.0.dist-info/entry_points.txt +5 -0
- pyfast-4.12.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
__constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST;
|
|
2
|
+
|
|
3
|
+
float getPixelAsFloat(__read_only image2d_t image, int2 pos) {
|
|
4
|
+
float value;
|
|
5
|
+
int dataType = get_image_channel_data_type(image);
|
|
6
|
+
if(dataType == CLK_FLOAT) {
|
|
7
|
+
value = read_imagef(image, sampler, pos).x;
|
|
8
|
+
} else if(dataType == CLK_UNSIGNED_INT8 || dataType == CLK_UNSIGNED_INT16 || dataType == CLK_UNSIGNED_INT32) {
|
|
9
|
+
value = read_imageui(image, sampler, pos).x;
|
|
10
|
+
} else {
|
|
11
|
+
value = read_imagei(image, sampler, pos).x;
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
__kernel void MAinitialize(
|
|
17
|
+
__read_only image2d_t input,
|
|
18
|
+
__write_only image2d_t output,
|
|
19
|
+
__write_only image2d_t memoryOut,
|
|
20
|
+
__private int frameCount
|
|
21
|
+
) {
|
|
22
|
+
const int2 pos = {get_global_id(0), get_global_id(1)};
|
|
23
|
+
|
|
24
|
+
float value = getPixelAsFloat(input, pos);
|
|
25
|
+
write_imagef(memoryOut, pos, value);
|
|
26
|
+
int dataType = get_image_channel_data_type(output);
|
|
27
|
+
if(dataType == CLK_FLOAT) {
|
|
28
|
+
write_imagef(output, pos, value);
|
|
29
|
+
} else {
|
|
30
|
+
// output image is of integer type, have to apply rounding
|
|
31
|
+
if(dataType == CLK_UNSIGNED_INT8 || dataType == CLK_UNSIGNED_INT16 || dataType == CLK_UNSIGNED_INT32) {
|
|
32
|
+
write_imageui(output, pos, (uint)value);
|
|
33
|
+
} else {
|
|
34
|
+
write_imagei(output, pos, (int)value);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
__kernel void MAiteration(
|
|
40
|
+
__read_only image2d_t input,
|
|
41
|
+
__read_only image2d_t memoryIn,
|
|
42
|
+
__read_only image2d_t last,
|
|
43
|
+
__write_only image2d_t output,
|
|
44
|
+
__write_only image2d_t memoryOut,
|
|
45
|
+
__private int frameCount
|
|
46
|
+
) {
|
|
47
|
+
const int2 pos = {get_global_id(0), get_global_id(1)};
|
|
48
|
+
|
|
49
|
+
float newValue = getPixelAsFloat(input, pos);
|
|
50
|
+
float oldMemory = read_imagef(memoryIn, sampler, pos).x;
|
|
51
|
+
float lastValue = getPixelAsFloat(last, pos);
|
|
52
|
+
float result = oldMemory + 1.0f/(float)frameCount * (newValue - lastValue);
|
|
53
|
+
write_imagef(memoryOut, pos, result);
|
|
54
|
+
|
|
55
|
+
int dataType = get_image_channel_data_type(output);
|
|
56
|
+
if(dataType == CLK_FLOAT) {
|
|
57
|
+
write_imagef(output, pos, result);
|
|
58
|
+
} else {
|
|
59
|
+
// output image is of integer type, have to apply rounding
|
|
60
|
+
if(dataType == CLK_UNSIGNED_INT8 || dataType == CLK_UNSIGNED_INT16 || dataType == CLK_UNSIGNED_INT32) {
|
|
61
|
+
write_imageui(output, pos, (uint)round(result));
|
|
62
|
+
} else {
|
|
63
|
+
write_imagei(output, pos, (int)round(result));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
__constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP | CLK_FILTER_NEAREST;
|
|
2
|
+
|
|
3
|
+
float getPixelAsFloat(__read_only image2d_t image, int2 pos) {
|
|
4
|
+
float value;
|
|
5
|
+
int dataType = get_image_channel_data_type(image);
|
|
6
|
+
if(dataType == CLK_FLOAT) {
|
|
7
|
+
value = read_imagef(image, sampler, pos).x;
|
|
8
|
+
} else if(dataType == CLK_UNSIGNED_INT8 || dataType == CLK_UNSIGNED_INT16 || dataType == CLK_UNSIGNED_INT32) {
|
|
9
|
+
value = read_imageui(image, sampler, pos).x;
|
|
10
|
+
} else {
|
|
11
|
+
value = read_imagei(image, sampler, pos).x;
|
|
12
|
+
}
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
__kernel void WMAinitialize(
|
|
17
|
+
__read_only image2d_t input,
|
|
18
|
+
__write_only image2d_t output,
|
|
19
|
+
__write_only image2d_t memoryOut,
|
|
20
|
+
__private int frameCount
|
|
21
|
+
) {
|
|
22
|
+
const int2 pos = {get_global_id(0), get_global_id(1)};
|
|
23
|
+
|
|
24
|
+
float value = getPixelAsFloat(input, pos);
|
|
25
|
+
float sum = value*frameCount;
|
|
26
|
+
float numerator = 0.0f;
|
|
27
|
+
for(int i = 0; i < frameCount; ++i) {
|
|
28
|
+
numerator += (i+1)*value;
|
|
29
|
+
}
|
|
30
|
+
float result = numerator / (frameCount*(frameCount + 1.0f)/2.0f);
|
|
31
|
+
|
|
32
|
+
write_imagef(memoryOut, pos, (float4)(sum, numerator, 0, 0));
|
|
33
|
+
|
|
34
|
+
int dataType = get_image_channel_data_type(output);
|
|
35
|
+
if(dataType == CLK_FLOAT) {
|
|
36
|
+
write_imagef(output, pos, result);
|
|
37
|
+
} else {
|
|
38
|
+
// output image is of integer type, have to apply rounding
|
|
39
|
+
if(dataType == CLK_UNSIGNED_INT8 || dataType == CLK_UNSIGNED_INT16 || dataType == CLK_UNSIGNED_INT32) {
|
|
40
|
+
write_imageui(output, pos, (uint)round(result));
|
|
41
|
+
} else {
|
|
42
|
+
write_imagei(output, pos, (int)round(result));
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
__kernel void WMAiteration(
|
|
48
|
+
__read_only image2d_t input,
|
|
49
|
+
__read_only image2d_t memoryIn,
|
|
50
|
+
__read_only image2d_t last,
|
|
51
|
+
__write_only image2d_t output,
|
|
52
|
+
__write_only image2d_t memoryOut,
|
|
53
|
+
__private int frameCount
|
|
54
|
+
) {
|
|
55
|
+
const int2 pos = {get_global_id(0), get_global_id(1)};
|
|
56
|
+
|
|
57
|
+
float newValue = getPixelAsFloat(input, pos);
|
|
58
|
+
float2 oldMemory = read_imagef(memoryIn, sampler, pos).xy;
|
|
59
|
+
float newTotal = oldMemory.x + newValue - getPixelAsFloat(last, pos);
|
|
60
|
+
float newNumerator = oldMemory.y + frameCount*newValue - oldMemory.x;
|
|
61
|
+
write_imagef(memoryOut, pos, (float4)(newTotal, newNumerator, 0, 0));
|
|
62
|
+
|
|
63
|
+
int dataType = get_image_channel_data_type(output);
|
|
64
|
+
if(dataType == CLK_FLOAT) {
|
|
65
|
+
write_imagef(output, pos, newNumerator / (frameCount*(frameCount + 1.0f)/2.0f));
|
|
66
|
+
} else {
|
|
67
|
+
// output image is of integer type, have to apply rounding
|
|
68
|
+
if(dataType == CLK_UNSIGNED_INT8 || dataType == CLK_UNSIGNED_INT16 || dataType == CLK_UNSIGNED_INT32) {
|
|
69
|
+
write_imageui(output, pos, (uint)round(newNumerator / (frameCount*(frameCount + 1.0f)/2.0f)));
|
|
70
|
+
} else {
|
|
71
|
+
write_imagei(output, pos, (int)round(newNumerator / (frameCount*(frameCount + 1.0f)/2.0f)));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
__constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_NONE | CLK_FILTER_NEAREST;
|
|
2
|
+
|
|
3
|
+
__kernel void segment(
|
|
4
|
+
__read_only image2d_t input,
|
|
5
|
+
__write_only image2d_t output,
|
|
6
|
+
__private int m_thresh,
|
|
7
|
+
__private int m_filterZeros
|
|
8
|
+
) {
|
|
9
|
+
const int2 pos = {get_global_id(0), get_global_id(1)};
|
|
10
|
+
float3 color = convert_float4(read_imageui(input, sampler, pos)).xyz;
|
|
11
|
+
|
|
12
|
+
uchar result = 0;
|
|
13
|
+
if ((!(m_filterZeros && all(color == 0))) && (length(color - (float3)(255, 255, 255)) > m_thresh)) {
|
|
14
|
+
result = 1;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
write_imageui(output, pos, result);
|
|
18
|
+
}
|
fast/kernels/Algorithms/TubeSegmentationAndCenterlineExtraction/InverseGradientSegmentation.cl
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
__constant sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;
|
|
2
|
+
|
|
3
|
+
#define LPOS(pos) pos.x+pos.y*get_global_size(0)+pos.z*get_global_size(0)*get_global_size(1)
|
|
4
|
+
|
|
5
|
+
__kernel void initGrowing(
|
|
6
|
+
__read_only image3d_t centerline,
|
|
7
|
+
#ifdef fast_3d_image_writes
|
|
8
|
+
__write_only image3d_t initSegmentation
|
|
9
|
+
#else
|
|
10
|
+
__global uchar * initSegmentation
|
|
11
|
+
#endif
|
|
12
|
+
) {
|
|
13
|
+
int4 pos = {get_global_id(0), get_global_id(1), get_global_id(2), 0};
|
|
14
|
+
if(read_imageui(centerline, sampler, pos).x > 0) {
|
|
15
|
+
uint radius = read_imageui(centerline, sampler, pos).x;
|
|
16
|
+
int N;
|
|
17
|
+
if(radius > 7) {
|
|
18
|
+
N = min(max(1, (int)(radius)), 5);
|
|
19
|
+
} else {
|
|
20
|
+
N = 1;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
for(int a = -N; a < N+1; a++) {
|
|
24
|
+
for(int b = -N; b < N+1; b++) {
|
|
25
|
+
for(int c = -N; c < N+1; c++) {
|
|
26
|
+
int4 n;
|
|
27
|
+
n.x = pos.x + a;
|
|
28
|
+
n.y = pos.y + b;
|
|
29
|
+
n.z = pos.z + c;
|
|
30
|
+
if(read_imageui(centerline, sampler, n).x == 0 && length((float3)(a,b,c)) <= N) {
|
|
31
|
+
#ifdef fast_3d_image_writes
|
|
32
|
+
write_imageui(initSegmentation, n, 2);
|
|
33
|
+
#else
|
|
34
|
+
if(n.x >= 0 && n.y >= 0 && n.z >= 0 &&
|
|
35
|
+
n.x < get_global_size(0) && n.y < get_global_size(1) && n.z < get_global_size(2))
|
|
36
|
+
initSegmentation[LPOS(n)] = 2;
|
|
37
|
+
#endif
|
|
38
|
+
}
|
|
39
|
+
}}}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
__kernel void grow(
|
|
45
|
+
__read_only image3d_t currentSegmentation,
|
|
46
|
+
__read_only image3d_t gvf,
|
|
47
|
+
#ifdef fast_3d_image_writes
|
|
48
|
+
__write_only image3d_t nextSegmentation,
|
|
49
|
+
#else
|
|
50
|
+
__global uchar* nextSegmentation,
|
|
51
|
+
#endif
|
|
52
|
+
__global int * stop
|
|
53
|
+
) {
|
|
54
|
+
|
|
55
|
+
int4 X = {get_global_id(0), get_global_id(1), get_global_id(2), 0};
|
|
56
|
+
char value = read_imageui(currentSegmentation, sampler, X).x;
|
|
57
|
+
// value of 2, means to check it, 1 means it is already accepted
|
|
58
|
+
if(value == 1) {
|
|
59
|
+
#ifdef fast_3d_image_writes
|
|
60
|
+
write_imageui(nextSegmentation, X, 1);
|
|
61
|
+
#else
|
|
62
|
+
nextSegmentation[LPOS(X)] = 1;
|
|
63
|
+
#endif
|
|
64
|
+
} else if(value == 2){
|
|
65
|
+
float4 FNX = read_imagef(gvf, sampler, X);
|
|
66
|
+
float FNXw = length(FNX.xyz);
|
|
67
|
+
|
|
68
|
+
bool continueGrowing = false;
|
|
69
|
+
for(int a = -1; a < 2; a++) {
|
|
70
|
+
for(int b = -1; b < 2; b++) {
|
|
71
|
+
for(int c = -1; c < 2; c++) {
|
|
72
|
+
if(a == 0 && b == 0 && c == 0)
|
|
73
|
+
continue;
|
|
74
|
+
|
|
75
|
+
int4 Y;
|
|
76
|
+
Y.x = X.x + a;
|
|
77
|
+
Y.y = X.y + b;
|
|
78
|
+
Y.z = X.z + c;
|
|
79
|
+
|
|
80
|
+
char valueY = read_imageui(currentSegmentation, sampler, Y).x;
|
|
81
|
+
if(valueY != 1) {
|
|
82
|
+
float4 FNY = read_imagef(gvf, sampler, Y);
|
|
83
|
+
FNY.w = length(FNY.xyz);
|
|
84
|
+
FNY.x /= FNY.w;
|
|
85
|
+
FNY.y /= FNY.w;
|
|
86
|
+
FNY.z /= FNY.w;
|
|
87
|
+
if(FNY.w > FNXw /*|| FNXw < 0.1f*/) {
|
|
88
|
+
int4 Z;
|
|
89
|
+
float maxDotProduct = -2.0f;
|
|
90
|
+
for(int a2 = -1; a2 < 2; a2++) {
|
|
91
|
+
for(int b2 = -1; b2 < 2; b2++) {
|
|
92
|
+
for(int c2 = -1; c2 < 2; c2++) {
|
|
93
|
+
if(a2 == 0 && b2 == 0 && c2 == 0)
|
|
94
|
+
continue;
|
|
95
|
+
int4 Zc;
|
|
96
|
+
Zc.x = Y.x+a2;
|
|
97
|
+
Zc.y = Y.y+b2;
|
|
98
|
+
Zc.z = Y.z+c2;
|
|
99
|
+
float3 YZ;
|
|
100
|
+
YZ.x = Zc.x-Y.x;
|
|
101
|
+
YZ.y = Zc.y-Y.y;
|
|
102
|
+
YZ.z = Zc.z-Y.z;
|
|
103
|
+
YZ = normalize(YZ);
|
|
104
|
+
if(dot(FNY.xyz, YZ) > maxDotProduct) {
|
|
105
|
+
maxDotProduct = dot(FNY.xyz, YZ);
|
|
106
|
+
Z = Zc;
|
|
107
|
+
}
|
|
108
|
+
}}}
|
|
109
|
+
|
|
110
|
+
if(Z.x == X.x && Z.y == X.y && Z.z == X.z) {
|
|
111
|
+
#ifdef fast_3d_image_writes
|
|
112
|
+
write_imageui(nextSegmentation, X, 1);
|
|
113
|
+
write_imageui(nextSegmentation, Y, 2);
|
|
114
|
+
#else
|
|
115
|
+
nextSegmentation[LPOS(X)] = 1;
|
|
116
|
+
// Check if in bounds
|
|
117
|
+
if(Y.x >= 0 && Y.y >= 0 && Y.z >= 0 &&
|
|
118
|
+
Y.x < get_global_size(0) && Y.y < get_global_size(1) && Y.z < get_global_size(2)) {
|
|
119
|
+
nextSegmentation[LPOS(Y)] = 2;
|
|
120
|
+
}
|
|
121
|
+
#endif
|
|
122
|
+
|
|
123
|
+
continueGrowing = true;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}}}
|
|
128
|
+
|
|
129
|
+
if(continueGrowing) {
|
|
130
|
+
// Added new items to list (values of 2)
|
|
131
|
+
stop[0] = 0;
|
|
132
|
+
} else {
|
|
133
|
+
// X was not accepted
|
|
134
|
+
#ifdef fast_3d_image_writes
|
|
135
|
+
write_imageui(nextSegmentation, X, 0);
|
|
136
|
+
#else
|
|
137
|
+
nextSegmentation[LPOS(X)] = 0;
|
|
138
|
+
#endif
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
__kernel void dilate(
|
|
144
|
+
__read_only image3d_t volume,
|
|
145
|
+
#ifdef fast_3d_image_writes
|
|
146
|
+
__write_only image3d_t result
|
|
147
|
+
#else
|
|
148
|
+
__global uchar * result
|
|
149
|
+
#endif
|
|
150
|
+
) {
|
|
151
|
+
int4 pos = {get_global_id(0), get_global_id(1), get_global_id(2), 0};
|
|
152
|
+
|
|
153
|
+
if(read_imageui(volume, sampler, pos).x == 1) {
|
|
154
|
+
for(int a = -1; a < 2 ; a++) {
|
|
155
|
+
for(int b = -1; b < 2 ; b++) {
|
|
156
|
+
for(int c = -1; c < 2 ; c++) {
|
|
157
|
+
int4 nPos = pos + (int4)(a,b,c,0);
|
|
158
|
+
#ifdef fast_3d_image_writes
|
|
159
|
+
write_imageui(result, nPos, 1);
|
|
160
|
+
#else
|
|
161
|
+
// Check if in bounds
|
|
162
|
+
if(nPos.x >= 0 && nPos.y >= 0 && nPos.z >= 0 &&
|
|
163
|
+
nPos.x < get_global_size(0) && nPos.y < get_global_size(1) && nPos.z < get_global_size(2))
|
|
164
|
+
result[LPOS(nPos)] = 1;
|
|
165
|
+
#endif
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
__kernel void erode(
|
|
173
|
+
__read_only image3d_t volume,
|
|
174
|
+
#ifdef fast_3d_image_writes
|
|
175
|
+
__write_only image3d_t result
|
|
176
|
+
#else
|
|
177
|
+
__global uchar * result
|
|
178
|
+
#endif
|
|
179
|
+
) {
|
|
180
|
+
int4 pos = {get_global_id(0), get_global_id(1), get_global_id(2), 0};
|
|
181
|
+
|
|
182
|
+
int value = read_imageui(volume, sampler, pos).x;
|
|
183
|
+
if(value == 1) {
|
|
184
|
+
bool keep = true;
|
|
185
|
+
for(int a = -1; a < 2 ; a++) {
|
|
186
|
+
for(int b = -1; b < 2 ; b++) {
|
|
187
|
+
for(int c = -1; c < 2 ; c++) {
|
|
188
|
+
keep = (read_imageui(volume, sampler, pos + (int4)(a,b,c,0)).x == 1 && keep);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
#ifdef fast_3d_image_writes
|
|
193
|
+
write_imageui(result, pos, keep ? 1 : 0);
|
|
194
|
+
} else {
|
|
195
|
+
write_imageui(result, pos, 0);
|
|
196
|
+
}
|
|
197
|
+
#else
|
|
198
|
+
result[LPOS(pos)] = keep ? 1 : 0;
|
|
199
|
+
} else {
|
|
200
|
+
result[LPOS(pos)] = 0;
|
|
201
|
+
}
|
|
202
|
+
#endif
|
|
203
|
+
}
|