├── .gitignore
├── .npmignore
├── LICENSE
├── dist
├── pixpipe.es6.js
├── pixpipe.es6.js.map
├── pixpipe.esmodule.js
├── pixpipe.esmodule.js.map
├── pixpipe.js
├── pixpipe.js.map
└── pixpipe.min.js
├── doc
├── assets
│ ├── anchor.js
│ ├── bass-addons.css
│ ├── bass.css
│ ├── favicon.png
│ ├── fonts
│ │ ├── EOT
│ │ │ ├── SourceCodePro-Bold.eot
│ │ │ └── SourceCodePro-Regular.eot
│ │ ├── LICENSE.txt
│ │ ├── OTF
│ │ │ ├── SourceCodePro-Bold.otf
│ │ │ └── SourceCodePro-Regular.otf
│ │ ├── TTF
│ │ │ ├── SourceCodePro-Bold.ttf
│ │ │ └── SourceCodePro-Regular.ttf
│ │ ├── WOFF
│ │ │ ├── OTF
│ │ │ │ ├── SourceCodePro-Bold.otf.woff
│ │ │ │ └── SourceCodePro-Regular.otf.woff
│ │ │ └── TTF
│ │ │ │ ├── SourceCodePro-Bold.ttf.woff
│ │ │ │ └── SourceCodePro-Regular.ttf.woff
│ │ ├── WOFF2
│ │ │ ├── OTF
│ │ │ │ ├── SourceCodePro-Bold.otf.woff2
│ │ │ │ └── SourceCodePro-Regular.otf.woff2
│ │ │ └── TTF
│ │ │ │ ├── SourceCodePro-Bold.ttf.woff2
│ │ │ │ └── SourceCodePro-Regular.ttf.woff2
│ │ └── source-code-pro.css
│ ├── github.css
│ ├── name_1000.png
│ ├── site.js
│ ├── split.css
│ ├── split.js
│ └── style.css
└── index.html
├── docgen
├── ConfigGenerator.js
├── config.yml
└── themes
│ └── pixpipe_theme
│ ├── README.md
│ ├── assets
│ ├── anchor.js
│ ├── bass-addons.css
│ ├── bass.css
│ ├── favicon.png
│ ├── fonts
│ │ ├── EOT
│ │ │ ├── SourceCodePro-Bold.eot
│ │ │ └── SourceCodePro-Regular.eot
│ │ ├── LICENSE.txt
│ │ ├── OTF
│ │ │ ├── SourceCodePro-Bold.otf
│ │ │ └── SourceCodePro-Regular.otf
│ │ ├── TTF
│ │ │ ├── SourceCodePro-Bold.ttf
│ │ │ └── SourceCodePro-Regular.ttf
│ │ ├── WOFF
│ │ │ ├── OTF
│ │ │ │ ├── SourceCodePro-Bold.otf.woff
│ │ │ │ └── SourceCodePro-Regular.otf.woff
│ │ │ └── TTF
│ │ │ │ ├── SourceCodePro-Bold.ttf.woff
│ │ │ │ └── SourceCodePro-Regular.ttf.woff
│ │ ├── WOFF2
│ │ │ ├── OTF
│ │ │ │ ├── SourceCodePro-Bold.otf.woff2
│ │ │ │ └── SourceCodePro-Regular.otf.woff2
│ │ │ └── TTF
│ │ │ │ ├── SourceCodePro-Bold.ttf.woff2
│ │ │ │ └── SourceCodePro-Regular.ttf.woff2
│ │ └── source-code-pro.css
│ ├── github.css
│ ├── name_1000.png
│ ├── site.js
│ ├── split.css
│ ├── split.js
│ └── style.css
│ ├── index._
│ ├── index.js
│ ├── note._
│ ├── paramProperty._
│ ├── section._
│ └── section_list._
├── examples
├── IDWSparseInterpolation.html
├── Image2DToPixBinConverter.html
├── Image2DToPixblock.html
├── Image2DToPixpConverter.html
├── Image3DToMosaic.html
├── Image3DToPixBinConverter.html
├── Image3DToPixpConverter.html
├── NaturalNeighborSparseInterpolation.html
├── SegmentSampleImage2D.html
├── TriangleSparseInterpolation.html
├── bjs_texture3D_example.html
├── bjs_texture3D_example2.html
├── bjs_texture3D_example3.html
├── colormap.html
├── contourHolesImage2D.html
├── contourImage2D.html
├── contourSimplifiedImage2D.html
├── cropImage2D.html
├── css
│ └── style.css
├── decodePixBin.html
├── derivativeImage2D.html
├── differenceEqSignal1D.html
├── encodePixBin.html
├── fftBandPassSignal1D.html
├── fftHiLoPassSignal1D.html
├── fftImage2D.html
├── fftImage2D_loadPicture.html
├── fftLoPassSignal1D.html
├── fftSignal1D.html
├── fileToArrayBuffer.html
├── fileToEDF.html
├── fileToGenericImage2D.html
├── fileToGenericImage3D.html
├── fileToGenericMesh3D.html
├── fileToGenericSignal1D.html
├── fileToImage2D.html
├── fileToJpeg.html
├── fileToMgh.html
├── fileToMinc2.html
├── fileToMniObj.html
├── fileToModEeg.html
├── fileToNifti.html
├── fileToPixp.html
├── fileToPng.html
├── fileToTiff.html
├── floodFillImage2D.html
├── forEachPixel.html
├── forEachPixelGradient.html
├── forEachPixelGradientBlend.html
├── gradientHueWheelImage2D.html
├── gradientImage2D.html
├── image2DToCanvas.html
├── imageBlending.html
├── imageBlending2.html
├── imageProjectMerge.html
├── imageThresholding.html
├── images
│ ├── githubLogo.png
│ ├── mask.png
│ ├── ny1.jpg
│ ├── ny2.jpg
│ ├── org_logo_512.png
│ ├── portrait1.jpg
│ ├── portrait2.jpg
│ ├── portrait3.jpg
│ ├── prefix_001_gray_surface.obj
│ ├── prefix_001_gray_surface.obj.gz
│ ├── sd.jpg
│ ├── sd.pixp
│ └── segmentedBrain.png
├── js
│ ├── CanvasSpliner.js
│ ├── PlaneShifter.js
│ ├── TrackballControls.js
│ ├── ndarray.js
│ ├── shaders.js
│ ├── shadersTime.js
│ └── shadersTimeCurve.js
├── mesh3DVolumetricHull.html
├── meshInsideOutside.html
├── meshInsideOutsideCube.html
├── meshInsideOutsideSphere.html
├── multiFileToMultiImage2D.html
├── multiplyImage2D.html
├── nearestSparseInterpolation.html
├── nniColormap.html
├── patchImage2D.html
├── photoColorMap.html
├── pixpFileToImage2D.html
├── segmentSamplingImage3D.html
├── spatialConvolImage2D.html
├── terrainRgbToElevation.html
├── tiffPixelData.html
├── urlFileToArrayBuffer.html
├── urlFileToTextFile.html
├── urlToImage2D.html
├── urlToImage2D_multiple.html
├── volume3DNavigatorSegment.html
├── volume3DNavigatorTime.html
└── volume3DNavigatorTimeCurve.html
├── examples_node
└── createImage2D.js
├── header.txt
├── images
├── pixpipe.png
└── pixpipe256.png
├── package-lock.json
├── package.json
├── pipeline.md
├── readme.md
├── rollup.config.dev.js
├── rollup.config.js
└── src
├── core
├── CoreTypes.js
├── Decoder.js
├── Filter.js
├── Image2D.js
├── Image3D.js
├── ImageToImageFilter.js
├── LineString.js
├── Mesh3D.js
├── PixpipeContainer.js
├── PixpipeContainerMultiData.js
├── PixpipeObject.js
├── Signal1D.js
└── readme.md
├── decoder
├── AllFormatsGenericDecoder.js
├── EdfDecoder.js
├── EegModDecoder.js
├── GenericDecoderInterface.js
├── Image2DGenericDecoder.js
├── Image3DGenericDecoder.js
├── JSONDecoder.js
├── JpegDecoder.js
├── Mesh3DGenericDecoder.js
├── MghDecoder.js
├── Minc2Decoder.js
├── MniObjDecoder.js
├── NiftiDecoder.js
├── PixBinDecoder.js
├── PixBinEncoder.js
├── PixpDecoder.js
├── PixpEncoder.js
├── PngDecoder.js
├── Signal1DGenericDecoder.js
├── TiffDecoder.js
└── readme.md
├── filter
├── ApplyColormapFilter.js
├── BandPassSignal1D.js
├── ComponentMergeImage2DFilter.js
├── ComponentProjectionImage2DFilter.js
├── ContourHolesImage2DFilter.js
├── ContourImage2DFilter.js
├── CropImageFilter.js
├── DifferenceEquationSignal1D.js
├── FloodFillImageFilter.js
├── ForEachPixelImageFilter.js
├── ForEachPixelReadOnlyFilter.js
├── FourierImageFilters.js
├── FourierSignalFilters.js
├── GradientImageFilter.js
├── HighPassSignal1D.js
├── IDWSparseInterpolationImageFilter.js
├── Image3DToMosaicFilter.js
├── ImageBlendExpressionFilter.js
├── ImageDerivativeFilter.js
├── LowPassFreqSignal1D.js
├── LowPassSignal1D.js
├── Mesh3DToVolumetricHullFilter.js
├── MultiplyImageFilter.js
├── NaturalNeighborSparseInterpolationImageFilter.js
├── NearestNeighborSparseInterpolationImageFilter.js
├── NormalizeImageFilter.js
├── PatchImageFilter.js
├── SimpleThresholdFilter.js
├── SimplifyLineStringFilter.js
├── SpatialConvolutionFilter.js
├── SpectralScaleImageFilter.js
├── TerrainRgbToElevationImageFilter.js
├── TriangulationSparseInterpolationImageFilter.js
└── readme.md
├── helper
├── AngleToHueWheelHelper.js
├── ColorScales.js
├── Colormap.js
├── LineStringPrinterOnImage2DHelper.js
└── readme.md
├── io
├── BrowserDownloadBuffer.js
├── CanvasImageWriter.js
├── FileImageReader.js
├── FileToArrayBufferReader.js
├── UrlImageReader.js
├── UrlToArrayBufferReader.js
└── readme.md
├── pixpipe.js
└── utils
├── FunctionGenerator.js
├── Image3DMetadataConverter.js
├── MatrixTricks.js
└── readme.md
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 |
6 | # Runtime data
7 | pids
8 | *.pid
9 | *.seed
10 |
11 | # Directory for instrumented libs generated by jscoverage/JSCover
12 | lib-cov
13 |
14 | # Coverage directory used by tools like istanbul
15 | coverage
16 |
17 | # nyc test coverage
18 | .nyc_output
19 |
20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21 | .grunt
22 |
23 | # node-waf configuration
24 | .lock-wscript
25 |
26 | # Compiled binary addons (http://nodejs.org/api/addons.html)
27 | build/Release
28 |
29 | # Dependency directories
30 | node_modules
31 | jspm_packages
32 |
33 | # Optional npm cache directory
34 | .npm
35 |
36 | # Optional REPL history
37 | .node_repl_history
38 |
39 | experiments
40 | .DS_Store
41 |
42 |
43 | testdata
44 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | doc
2 | examples
3 | examples_node
4 | images
5 | src
6 | testdata
7 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017 Jonathan Lurie
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/doc/assets/bass-addons.css:
--------------------------------------------------------------------------------
1 | .input {
2 | font-family: inherit;
3 | display: block;
4 | width: 100%;
5 | height: 2rem;
6 | padding: .5rem;
7 | margin-bottom: 1rem;
8 | border: 1px solid #ccc;
9 | font-size: .875rem;
10 | border-radius: 3px;
11 | box-sizing: border-box;
12 | }
13 |
--------------------------------------------------------------------------------
/doc/assets/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/doc/assets/favicon.png
--------------------------------------------------------------------------------
/doc/assets/fonts/EOT/SourceCodePro-Bold.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/doc/assets/fonts/EOT/SourceCodePro-Bold.eot
--------------------------------------------------------------------------------
/doc/assets/fonts/EOT/SourceCodePro-Regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/doc/assets/fonts/EOT/SourceCodePro-Regular.eot
--------------------------------------------------------------------------------
/doc/assets/fonts/OTF/SourceCodePro-Bold.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/doc/assets/fonts/OTF/SourceCodePro-Bold.otf
--------------------------------------------------------------------------------
/doc/assets/fonts/OTF/SourceCodePro-Regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/doc/assets/fonts/OTF/SourceCodePro-Regular.otf
--------------------------------------------------------------------------------
/doc/assets/fonts/TTF/SourceCodePro-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/doc/assets/fonts/TTF/SourceCodePro-Bold.ttf
--------------------------------------------------------------------------------
/doc/assets/fonts/TTF/SourceCodePro-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/doc/assets/fonts/TTF/SourceCodePro-Regular.ttf
--------------------------------------------------------------------------------
/doc/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/doc/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff
--------------------------------------------------------------------------------
/doc/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/doc/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff
--------------------------------------------------------------------------------
/doc/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/doc/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff
--------------------------------------------------------------------------------
/doc/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/doc/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff
--------------------------------------------------------------------------------
/doc/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/doc/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2
--------------------------------------------------------------------------------
/doc/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/doc/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2
--------------------------------------------------------------------------------
/doc/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/doc/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2
--------------------------------------------------------------------------------
/doc/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/doc/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2
--------------------------------------------------------------------------------
/doc/assets/fonts/source-code-pro.css:
--------------------------------------------------------------------------------
1 | @font-face{
2 | font-family: 'Source Code Pro';
3 | font-weight: 400;
4 | font-style: normal;
5 | font-stretch: normal;
6 | src: url('EOT/SourceCodePro-Regular.eot') format('embedded-opentype'),
7 | url('WOFF2/TTF/SourceCodePro-Regular.ttf.woff2') format('woff2'),
8 | url('WOFF/OTF/SourceCodePro-Regular.otf.woff') format('woff'),
9 | url('OTF/SourceCodePro-Regular.otf') format('opentype'),
10 | url('TTF/SourceCodePro-Regular.ttf') format('truetype');
11 | }
12 |
13 | @font-face{
14 | font-family: 'Source Code Pro';
15 | font-weight: 700;
16 | font-style: normal;
17 | font-stretch: normal;
18 | src: url('EOT/SourceCodePro-Bold.eot') format('embedded-opentype'),
19 | url('WOFF2/TTF/SourceCodePro-Bold.ttf.woff2') format('woff2'),
20 | url('WOFF/OTF/SourceCodePro-Bold.otf.woff') format('woff'),
21 | url('OTF/SourceCodePro-Bold.otf') format('opentype'),
22 | url('TTF/SourceCodePro-Bold.ttf') format('truetype');
23 | }
24 |
--------------------------------------------------------------------------------
/doc/assets/github.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | github.com style (c) Vasily Polovnyov
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | color: #333;
12 | background: #f8f8f8;
13 | -webkit-text-size-adjust: none;
14 | }
15 |
16 | .hljs-comment,
17 | .diff .hljs-header,
18 | .hljs-javadoc {
19 | color: #998;
20 | font-style: italic;
21 | }
22 |
23 | .hljs-keyword,
24 | .css .rule .hljs-keyword,
25 | .hljs-winutils,
26 | .nginx .hljs-title,
27 | .hljs-subst,
28 | .hljs-request,
29 | .hljs-status {
30 | color: #1184CE;
31 | }
32 |
33 | .hljs-number,
34 | .hljs-hexcolor,
35 | .ruby .hljs-constant {
36 | color: #ed225d;
37 | }
38 |
39 | .hljs-string,
40 | .hljs-tag .hljs-value,
41 | .hljs-phpdoc,
42 | .hljs-dartdoc,
43 | .tex .hljs-formula {
44 | color: #ed225d;
45 | }
46 |
47 | .hljs-title,
48 | .hljs-id,
49 | .scss .hljs-preprocessor {
50 | color: #900;
51 | font-weight: bold;
52 | }
53 |
54 | .hljs-list .hljs-keyword,
55 | .hljs-subst {
56 | font-weight: normal;
57 | }
58 |
59 | .hljs-class .hljs-title,
60 | .hljs-type,
61 | .vhdl .hljs-literal,
62 | .tex .hljs-command {
63 | color: #458;
64 | font-weight: bold;
65 | }
66 |
67 | .hljs-tag,
68 | .hljs-tag .hljs-title,
69 | .hljs-rules .hljs-property,
70 | .django .hljs-tag .hljs-keyword {
71 | color: #000080;
72 | font-weight: normal;
73 | }
74 |
75 | .hljs-attribute,
76 | .hljs-variable,
77 | .lisp .hljs-body {
78 | color: #008080;
79 | }
80 |
81 | .hljs-regexp {
82 | color: #009926;
83 | }
84 |
85 | .hljs-symbol,
86 | .ruby .hljs-symbol .hljs-string,
87 | .lisp .hljs-keyword,
88 | .clojure .hljs-keyword,
89 | .scheme .hljs-keyword,
90 | .tex .hljs-special,
91 | .hljs-prompt {
92 | color: #990073;
93 | }
94 |
95 | .hljs-built_in {
96 | color: #0086b3;
97 | }
98 |
99 | .hljs-preprocessor,
100 | .hljs-pragma,
101 | .hljs-pi,
102 | .hljs-doctype,
103 | .hljs-shebang,
104 | .hljs-cdata {
105 | color: #999;
106 | font-weight: bold;
107 | }
108 |
109 | .hljs-deletion {
110 | background: #fdd;
111 | }
112 |
113 | .hljs-addition {
114 | background: #dfd;
115 | }
116 |
117 | .diff .hljs-change {
118 | background: #0086b3;
119 | }
120 |
121 | .hljs-chunk {
122 | color: #aaa;
123 | }
124 |
--------------------------------------------------------------------------------
/doc/assets/name_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/doc/assets/name_1000.png
--------------------------------------------------------------------------------
/doc/assets/split.css:
--------------------------------------------------------------------------------
1 | .gutter {
2 | background-color: #f5f5f5;
3 | background-repeat: no-repeat;
4 | background-position: 50%;
5 | }
6 |
7 | .gutter.gutter-vertical {
8 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII=');
9 | cursor: ns-resize;
10 | }
11 |
12 | .gutter.gutter-horizontal {
13 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
14 | cursor: ew-resize;
15 | }
16 |
--------------------------------------------------------------------------------
/doc/assets/style.css:
--------------------------------------------------------------------------------
1 | .documentation {
2 | font-family: Helvetica, sans-serif;
3 | color: #666;
4 | line-height: 1.5;
5 | background: #f5f5f5;
6 | }
7 |
8 | .black {
9 | color: #666;
10 | }
11 |
12 | .bg-white {
13 | background-color: #fff;
14 | }
15 |
16 | h4 {
17 | margin: 20px 0 10px 0;
18 | }
19 |
20 | .documentation h3 {
21 | color: #000;
22 | }
23 |
24 | .border-bottom {
25 | border-color: #ddd;
26 | }
27 |
28 | a {
29 | color: #ff7acf;
30 | text-decoration: none;
31 | }
32 |
33 | .documentation a[href]:hover {
34 | text-decoration: underline;
35 | }
36 |
37 | a:hover {
38 | cursor: pointer;
39 | }
40 |
41 | .py1-ul li {
42 | padding: 5px 0;
43 | }
44 |
45 | .max-height-100 {
46 | max-height: 100%;
47 | }
48 |
49 | .height-viewport-100 {
50 | height: 100vh;
51 | }
52 |
53 | section:target h3 {
54 | font-weight:700;
55 | }
56 |
57 | .documentation td,
58 | .documentation th {
59 | padding: .25rem .25rem;
60 | }
61 |
62 | h1:hover .anchorjs-link,
63 | h2:hover .anchorjs-link,
64 | h3:hover .anchorjs-link,
65 | h4:hover .anchorjs-link {
66 | opacity: 1;
67 | }
68 |
69 | .fix-3 {
70 | width: 25%;
71 | max-width: 244px;
72 | }
73 |
74 | .fix-3 {
75 | width: 25%;
76 | max-width: 244px;
77 | }
78 |
79 | @media (min-width: 52em) {
80 | .fix-margin-3 {
81 | margin-left: 25%;
82 | }
83 | }
84 |
85 | .pre, pre, code, .code {
86 | font-family: Source Code Pro,Menlo,Consolas,Liberation Mono,monospace;
87 | font-size: 14px;
88 | }
89 |
90 | .fill-light {
91 | background: #F9F9F9;
92 | }
93 |
94 | .width2 {
95 | width: 1rem;
96 | }
97 |
98 | .input {
99 | font-family: inherit;
100 | display: block;
101 | width: 100%;
102 | height: 2rem;
103 | padding: .5rem;
104 | margin-bottom: 1rem;
105 | border: 1px solid #ccc;
106 | font-size: .875rem;
107 | border-radius: 3px;
108 | box-sizing: border-box;
109 | }
110 |
111 | table {
112 | border-collapse: collapse;
113 | }
114 |
115 | .prose table th,
116 | .prose table td {
117 | text-align: left;
118 | padding:8px;
119 | border:1px solid #ddd;
120 | }
121 |
122 | .prose table th:nth-child(1) { border-right: none; }
123 | .prose table th:nth-child(2) { border-left: none; }
124 |
125 | .prose table {
126 | border:1px solid #ddd;
127 | }
128 |
129 | .prose-big {
130 | font-size: 18px;
131 | line-height: 30px;
132 | }
133 |
134 | .quiet {
135 | opacity: 0.7;
136 | }
137 |
138 | .minishadow {
139 | box-shadow: 2px 2px 10px #f3f3f3;
140 | }
141 |
142 |
143 | textarea, input, button { outline: none; }
144 |
145 | .width100pc {
146 | width: 100%;
147 | }
148 |
149 | p code {
150 | padding: 2px 4px;
151 | border-radius: 3px;
152 | background: #f5f5f5;
153 | font-family: monospace;
154 | }
155 |
--------------------------------------------------------------------------------
/docgen/ConfigGenerator.js:
--------------------------------------------------------------------------------
1 | const YAML = require('yamljs');
2 |
3 | var path = require('path'), fs=require('fs');
4 |
5 | let srcRoot = "src";
6 |
7 | function isDirectory( source ){
8 | return fs.lstatSync(source).isDirectory()
9 | }
10 |
11 | const getDirectories = source =>
12 | fs.readdirSync(source).map(name => path.join(source, name)).filter(isDirectory).map( thepath => path.basename( thepath ));
13 |
14 | function fromDir(startPath,filter, listToAdd){
15 | if (!fs.existsSync(startPath)){
16 | console.log("no dir ",startPath);
17 | return;
18 | }
19 |
20 | var files=fs.readdirSync(startPath);
21 | for(var i=0;i=0) {
28 | //console.log('-- found: ',filename);
29 | //listToAdd.push( filename )
30 | listToAdd.push( path.basename(filename) )
31 | };
32 | };
33 | };
34 |
35 |
36 | let srcDirs = getDirectories( srcRoot ).map( sd => ({srcDirName: sd, jsFiles: []}));
37 |
38 | srcDirs.forEach(function( srcDir ){
39 | fromDir( path.join( srcRoot, srcDir.srcDirName ),'.js', srcDir.jsFiles);
40 | })
41 |
42 | //console.log( srcDirs );
43 |
44 |
45 |
46 | let config = {
47 | toc: []
48 | }
49 |
50 |
51 |
52 | srcDirs.forEach(function( srcDir ){
53 | let titleElement = {
54 | name: "_" + srcDir.srcDirName.toUpperCase() + ""
55 | }
56 |
57 | let localReadmePath = path.join( srcRoot, srcDir.srcDirName, "readme.md" );
58 | if (fs.existsSync(localReadmePath)){
59 | titleElement["file"] = "../" + localReadmePath;
60 | }
61 |
62 | config.toc.push( titleElement )
63 |
64 | let allSubSections = srcDir.jsFiles.map( section => path.basename(section, ".js"))
65 | config.toc = config.toc.concat( allSubSections );
66 | })
67 |
68 |
69 |
70 | config.toc.push( { name: "_misc"} )
71 |
72 |
73 |
74 |
75 |
76 | let ym = YAML.stringify( config, 4 );
77 | fs.writeFileSync('./docgen/config.yml', ym);
78 |
--------------------------------------------------------------------------------
/docgen/config.yml:
--------------------------------------------------------------------------------
1 | toc:
2 | -
3 | name: _CORE
4 | file: ../src/core/readme.md
5 | - CoreTypes
6 | - Decoder
7 | - Filter
8 | - Image2D
9 | - Image3D
10 | - ImageToImageFilter
11 | - LineString
12 | - Mesh3D
13 | - PixpipeContainer
14 | - PixpipeContainerMultiData
15 | - PixpipeObject
16 | - Signal1D
17 | -
18 | name: _DECODER
19 | file: ../src/decoder/readme.md
20 | - AllFormatsGenericDecoder
21 | - EdfDecoder
22 | - EegModDecoder
23 | - GenericDecoderInterface
24 | - Image2DGenericDecoder
25 | - Image3DGenericDecoder
26 | - JSONDecoder
27 | - JpegDecoder
28 | - Mesh3DGenericDecoder
29 | - MghDecoder
30 | - Minc2Decoder
31 | - MniObjDecoder
32 | - NiftiDecoder
33 | - PixBinDecoder
34 | - PixBinEncoder
35 | - PixpDecoder
36 | - PixpEncoder
37 | - PngDecoder
38 | - Signal1DGenericDecoder
39 | - TiffDecoder
40 | -
41 | name: _FILTER
42 | file: ../src/filter/readme.md
43 | - ApplyColormapFilter
44 | - BandPassSignal1D
45 | - ComponentMergeImage2DFilter
46 | - ComponentProjectionImage2DFilter
47 | - ContourHolesImage2DFilter
48 | - ContourImage2DFilter
49 | - CropImageFilter
50 | - DifferenceEquationSignal1D
51 | - FloodFillImageFilter
52 | - ForEachPixelImageFilter
53 | - ForEachPixelReadOnlyFilter
54 | - FourierImageFilters
55 | - FourierSignalFilters
56 | - GradientImageFilter
57 | - HighPassSignal1D
58 | - IDWSparseInterpolationImageFilter
59 | - Image3DToMosaicFilter
60 | - ImageBlendExpressionFilter
61 | - ImageDerivativeFilter
62 | - LowPassFreqSignal1D
63 | - LowPassSignal1D
64 | - Mesh3DToVolumetricHullFilter
65 | - MultiplyImageFilter
66 | - NaturalNeighborSparseInterpolationImageFilter
67 | - NearestNeighborSparseInterpolationImageFilter
68 | - NormalizeImageFilter
69 | - PatchImageFilter
70 | - SimpleThresholdFilter
71 | - SimplifyLineStringFilter
72 | - SpatialConvolutionFilter
73 | - SpectralScaleImageFilter
74 | - TerrainRgbToElevationImageFilter
75 | - TriangulationSparseInterpolationImageFilter
76 | -
77 | name: _HELPER
78 | file: ../src/helper/readme.md
79 | - AngleToHueWheelHelper
80 | - ColorScales
81 | - Colormap
82 | - LineStringPrinterOnImage2DHelper
83 | -
84 | name: _IO
85 | file: ../src/io/readme.md
86 | - BrowserDownloadBuffer
87 | - CanvasImageWriter
88 | - FileImageReader
89 | - FileToArrayBufferReader
90 | - UrlImageReader
91 | - UrlToArrayBufferReader
92 | -
93 | name: _UTILS
94 | file: ../src/utils/readme.md
95 | - FunctionGenerator
96 | - Image3DMetadataConverter
97 | - MatrixTricks
98 | -
99 | name: _misc
100 |
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/README.md:
--------------------------------------------------------------------------------
1 | # the default theme
2 |
3 | 
4 |
5 | This is the default theme for [documentationjs](https://github.com/documentationjs):
6 | it consists of underscore templates and a few assets: a [highlight.js](https://highlightjs.org/)
7 | theme and [basscss](http://www.basscss.com/) as a basic CSS framework.
8 |
9 | This is bundled by default in documentation: it is the default theme.
10 |
11 | The contents are the following:
12 |
13 | * `index._`, the main template that defines the document structure
14 | * `section._`, a partial used to render each chunk of documentation
15 | * `assets/*`, any assets, including CSS & JS
16 |
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/bass-addons.css:
--------------------------------------------------------------------------------
1 | .input {
2 | font-family: inherit;
3 | display: block;
4 | width: 100%;
5 | height: 2rem;
6 | padding: .5rem;
7 | margin-bottom: 1rem;
8 | border: 1px solid #ccc;
9 | font-size: .875rem;
10 | border-radius: 3px;
11 | box-sizing: border-box;
12 | }
13 |
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/docgen/themes/pixpipe_theme/assets/favicon.png
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/fonts/EOT/SourceCodePro-Bold.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/docgen/themes/pixpipe_theme/assets/fonts/EOT/SourceCodePro-Bold.eot
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/fonts/EOT/SourceCodePro-Regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/docgen/themes/pixpipe_theme/assets/fonts/EOT/SourceCodePro-Regular.eot
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/fonts/OTF/SourceCodePro-Bold.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/docgen/themes/pixpipe_theme/assets/fonts/OTF/SourceCodePro-Bold.otf
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/fonts/OTF/SourceCodePro-Regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/docgen/themes/pixpipe_theme/assets/fonts/OTF/SourceCodePro-Regular.otf
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/fonts/TTF/SourceCodePro-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/docgen/themes/pixpipe_theme/assets/fonts/TTF/SourceCodePro-Bold.ttf
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/fonts/TTF/SourceCodePro-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/docgen/themes/pixpipe_theme/assets/fonts/TTF/SourceCodePro-Regular.ttf
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/docgen/themes/pixpipe_theme/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/docgen/themes/pixpipe_theme/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/docgen/themes/pixpipe_theme/assets/fonts/WOFF/TTF/SourceCodePro-Bold.ttf.woff
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/docgen/themes/pixpipe_theme/assets/fonts/WOFF/TTF/SourceCodePro-Regular.ttf.woff
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/docgen/themes/pixpipe_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Bold.otf.woff2
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/docgen/themes/pixpipe_theme/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/docgen/themes/pixpipe_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/docgen/themes/pixpipe_theme/assets/fonts/WOFF2/TTF/SourceCodePro-Regular.ttf.woff2
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/fonts/source-code-pro.css:
--------------------------------------------------------------------------------
1 | @font-face{
2 | font-family: 'Source Code Pro';
3 | font-weight: 400;
4 | font-style: normal;
5 | font-stretch: normal;
6 | src: url('EOT/SourceCodePro-Regular.eot') format('embedded-opentype'),
7 | url('WOFF2/TTF/SourceCodePro-Regular.ttf.woff2') format('woff2'),
8 | url('WOFF/OTF/SourceCodePro-Regular.otf.woff') format('woff'),
9 | url('OTF/SourceCodePro-Regular.otf') format('opentype'),
10 | url('TTF/SourceCodePro-Regular.ttf') format('truetype');
11 | }
12 |
13 | @font-face{
14 | font-family: 'Source Code Pro';
15 | font-weight: 700;
16 | font-style: normal;
17 | font-stretch: normal;
18 | src: url('EOT/SourceCodePro-Bold.eot') format('embedded-opentype'),
19 | url('WOFF2/TTF/SourceCodePro-Bold.ttf.woff2') format('woff2'),
20 | url('WOFF/OTF/SourceCodePro-Bold.otf.woff') format('woff'),
21 | url('OTF/SourceCodePro-Bold.otf') format('opentype'),
22 | url('TTF/SourceCodePro-Bold.ttf') format('truetype');
23 | }
24 |
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/github.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | github.com style (c) Vasily Polovnyov
4 |
5 | */
6 |
7 | .hljs {
8 | display: block;
9 | overflow-x: auto;
10 | padding: 0.5em;
11 | color: #333;
12 | background: #f8f8f8;
13 | -webkit-text-size-adjust: none;
14 | }
15 |
16 | .hljs-comment,
17 | .diff .hljs-header,
18 | .hljs-javadoc {
19 | color: #998;
20 | font-style: italic;
21 | }
22 |
23 | .hljs-keyword,
24 | .css .rule .hljs-keyword,
25 | .hljs-winutils,
26 | .nginx .hljs-title,
27 | .hljs-subst,
28 | .hljs-request,
29 | .hljs-status {
30 | color: #1184CE;
31 | }
32 |
33 | .hljs-number,
34 | .hljs-hexcolor,
35 | .ruby .hljs-constant {
36 | color: #ed225d;
37 | }
38 |
39 | .hljs-string,
40 | .hljs-tag .hljs-value,
41 | .hljs-phpdoc,
42 | .hljs-dartdoc,
43 | .tex .hljs-formula {
44 | color: #ed225d;
45 | }
46 |
47 | .hljs-title,
48 | .hljs-id,
49 | .scss .hljs-preprocessor {
50 | color: #900;
51 | font-weight: bold;
52 | }
53 |
54 | .hljs-list .hljs-keyword,
55 | .hljs-subst {
56 | font-weight: normal;
57 | }
58 |
59 | .hljs-class .hljs-title,
60 | .hljs-type,
61 | .vhdl .hljs-literal,
62 | .tex .hljs-command {
63 | color: #458;
64 | font-weight: bold;
65 | }
66 |
67 | .hljs-tag,
68 | .hljs-tag .hljs-title,
69 | .hljs-rules .hljs-property,
70 | .django .hljs-tag .hljs-keyword {
71 | color: #000080;
72 | font-weight: normal;
73 | }
74 |
75 | .hljs-attribute,
76 | .hljs-variable,
77 | .lisp .hljs-body {
78 | color: #008080;
79 | }
80 |
81 | .hljs-regexp {
82 | color: #009926;
83 | }
84 |
85 | .hljs-symbol,
86 | .ruby .hljs-symbol .hljs-string,
87 | .lisp .hljs-keyword,
88 | .clojure .hljs-keyword,
89 | .scheme .hljs-keyword,
90 | .tex .hljs-special,
91 | .hljs-prompt {
92 | color: #990073;
93 | }
94 |
95 | .hljs-built_in {
96 | color: #0086b3;
97 | }
98 |
99 | .hljs-preprocessor,
100 | .hljs-pragma,
101 | .hljs-pi,
102 | .hljs-doctype,
103 | .hljs-shebang,
104 | .hljs-cdata {
105 | color: #999;
106 | font-weight: bold;
107 | }
108 |
109 | .hljs-deletion {
110 | background: #fdd;
111 | }
112 |
113 | .hljs-addition {
114 | background: #dfd;
115 | }
116 |
117 | .diff .hljs-change {
118 | background: #0086b3;
119 | }
120 |
121 | .hljs-chunk {
122 | color: #aaa;
123 | }
124 |
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/name_1000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/docgen/themes/pixpipe_theme/assets/name_1000.png
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/split.css:
--------------------------------------------------------------------------------
1 | .gutter {
2 | background-color: #f5f5f5;
3 | background-repeat: no-repeat;
4 | background-position: 50%;
5 | }
6 |
7 | .gutter.gutter-vertical {
8 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII=');
9 | cursor: ns-resize;
10 | }
11 |
12 | .gutter.gutter-horizontal {
13 | background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
14 | cursor: ew-resize;
15 | }
16 |
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/assets/style.css:
--------------------------------------------------------------------------------
1 | .documentation {
2 | font-family: Helvetica, sans-serif;
3 | color: #666;
4 | line-height: 1.5;
5 | background: #f5f5f5;
6 | }
7 |
8 | .black {
9 | color: #666;
10 | }
11 |
12 | .bg-white {
13 | background-color: #fff;
14 | }
15 |
16 | h4 {
17 | margin: 20px 0 10px 0;
18 | }
19 |
20 | .documentation h3 {
21 | color: #000;
22 | }
23 |
24 | .border-bottom {
25 | border-color: #ddd;
26 | }
27 |
28 | a {
29 | color: #ff7acf;
30 | text-decoration: none;
31 | }
32 |
33 | .documentation a[href]:hover {
34 | text-decoration: underline;
35 | }
36 |
37 | a:hover {
38 | cursor: pointer;
39 | }
40 |
41 | .py1-ul li {
42 | padding: 5px 0;
43 | }
44 |
45 | .max-height-100 {
46 | max-height: 100%;
47 | }
48 |
49 | .height-viewport-100 {
50 | height: 100vh;
51 | }
52 |
53 | section:target h3 {
54 | font-weight:700;
55 | }
56 |
57 | .documentation td,
58 | .documentation th {
59 | padding: .25rem .25rem;
60 | }
61 |
62 | h1:hover .anchorjs-link,
63 | h2:hover .anchorjs-link,
64 | h3:hover .anchorjs-link,
65 | h4:hover .anchorjs-link {
66 | opacity: 1;
67 | }
68 |
69 | .fix-3 {
70 | width: 25%;
71 | max-width: 244px;
72 | }
73 |
74 | .fix-3 {
75 | width: 25%;
76 | max-width: 244px;
77 | }
78 |
79 | @media (min-width: 52em) {
80 | .fix-margin-3 {
81 | margin-left: 25%;
82 | }
83 | }
84 |
85 | .pre, pre, code, .code {
86 | font-family: Source Code Pro,Menlo,Consolas,Liberation Mono,monospace;
87 | font-size: 14px;
88 | }
89 |
90 | .fill-light {
91 | background: #F9F9F9;
92 | }
93 |
94 | .width2 {
95 | width: 1rem;
96 | }
97 |
98 | .input {
99 | font-family: inherit;
100 | display: block;
101 | width: 100%;
102 | height: 2rem;
103 | padding: .5rem;
104 | margin-bottom: 1rem;
105 | border: 1px solid #ccc;
106 | font-size: .875rem;
107 | border-radius: 3px;
108 | box-sizing: border-box;
109 | }
110 |
111 | table {
112 | border-collapse: collapse;
113 | }
114 |
115 | .prose table th,
116 | .prose table td {
117 | text-align: left;
118 | padding:8px;
119 | border:1px solid #ddd;
120 | }
121 |
122 | .prose table th:nth-child(1) { border-right: none; }
123 | .prose table th:nth-child(2) { border-left: none; }
124 |
125 | .prose table {
126 | border:1px solid #ddd;
127 | }
128 |
129 | .prose-big {
130 | font-size: 18px;
131 | line-height: 30px;
132 | }
133 |
134 | .quiet {
135 | opacity: 0.7;
136 | }
137 |
138 | .minishadow {
139 | box-shadow: 2px 2px 10px #f3f3f3;
140 | }
141 |
142 |
143 | textarea, input, button { outline: none; }
144 |
145 | .width100pc {
146 | width: 100%;
147 | }
148 |
149 | p code {
150 | padding: 2px 4px;
151 | border-radius: 3px;
152 | background: #f5f5f5;
153 | font-family: monospace;
154 | }
155 |
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/note._:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <%- note.name %>
5 |
6 |
7 | <% if (note.description) { %>
8 | <%= md(note.description) %>
9 | <% } %>
10 |
11 |
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/paramProperty._:
--------------------------------------------------------------------------------
1 |
2 | <%- property.name %> <%= formatType(property.type) %>
3 | <% if (property.default) { %>
4 | (default <%- property.default %>
)
5 | <% } %>
6 | <%= md(property.description, true) %>
7 |
8 | <% if(property.properties && property.properties.length) { %>
9 | <% property.properties.forEach(function(childProperty) { %>
10 | <%= renderParamProperty({
11 | property: childProperty,
12 | renderParamProperty: renderParamProperty
13 | }) %>
14 | <% }) %>
15 | <% } %>
16 |
--------------------------------------------------------------------------------
/docgen/themes/pixpipe_theme/section_list._:
--------------------------------------------------------------------------------
1 |
2 | <% members.forEach(function(member) { %>
3 |
4 |
5 |
6 |
▸
7 |
<%= shortSignature(member) %>
8 |
9 |
10 |
11 | <%= renderSection({
12 | section: member,
13 | renderSection: renderSection,
14 | renderParamProperty: renderParamProperty,
15 | nested: true
16 | }) %>
17 |
18 |
19 | <% }) %>
20 |
21 |
--------------------------------------------------------------------------------
/examples/Image2DToPixpConverter.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Convert an Image2D to Pixp File
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | This does the following :
13 |
14 | opening a local image file, using pixpipe.FileImageReader
15 | converting it into a pixpipe.Image2D
object
16 | Feed a pixpipe.PixpEncoder
with the image to build a Pixp file stream
17 | download the pixp file with a button
18 |
19 |
20 |
21 |
22 |
23 | Select an image file:
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
92 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/examples/TriangleSparseInterpolation.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Triangulation
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This does the following :
15 |
16 | creating a set of random (sparse) points with random values
17 | Interpolate them using pixpipe.TriangulationSparseInterpolationImageFilter
18 | Applying a colormap jsut for fun with pixpipe.ApplyColormapFilter
19 | displaying the output image with a pixpipe.CanvasImageWriter
20 |
21 |
22 |
23 |
24 |
25 |
26 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/examples/contourHolesImage2D.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Contour and holes of Image2D
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This does the following :
15 |
16 | opening a distant image file with AJAX request, using pixpipe.UrlImageReader
17 | Computing the outer-polygons and hole-polygons from a seed with pixpipe.ContourHolesImage2DFilter
18 | Printing all the polygons on top of a copy of the input image with pixpipe.LineStringPrinterOnImage2DHelper
19 | Displaying it in a canvas using pixpipe.CanvasImageWriter
20 |
21 |
22 |
23 |
24 |
25 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/examples/contourImage2D.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Contour of Image2D
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This does the following :
15 |
16 | opening a distant image file with AJAX request, using pixpipe.UrlImageReader
17 | Computing the closest internal polygon from a seed with pixpipe.ContourHolesImage2DFilter
18 | Printing the polygons on top of a copy of the input image with pixpipe.LineStringPrinterOnImage2DHelper
19 | Displaying it in a canvas using pixpipe.CanvasImageWriter
20 |
21 |
22 |
23 |
24 |
25 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/examples/contourSimplifiedImage2D.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Simplify contour
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This does the following :
15 |
16 | opening a distant image file with AJAX request, using pixpipe.UrlImageReader
17 | Computing the closest internal polygon from a seed with pixpipe.ContourHolesImage2DFilter
18 | Simplifiying the contour using pixpipe.SimplifyLineStringFilter
to get only a small list of points
19 | Printing the polygons on top of a copy of the input image with pixpipe.LineStringPrinterOnImage2DHelper
20 | Displaying it in a canvas using pixpipe.CanvasImageWriter
21 |
22 |
23 |
24 |
25 |
26 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/examples/cropImage2D.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Crop Image2D
4 |
5 |
6 |
7 |
8 |
9 |
16 |
17 |
18 |
19 |
20 | This does the following :
21 |
22 | opening a local image file, using pixpipe.FileImageReader
23 | converting it into a pixpipe.Image2D
object
24 | croping it to keep only the center with pixpipe.Image2D
25 | display the crop in a canvas using pixpipe.CropImageFilter
26 |
27 | The first image displayed is the original. The second is the cropped.
28 | The cropped image discards the top/bottom/left/right quarters from the input, leaving only the middle half.
29 |
30 |
31 |
32 | Select an image file:
33 |
34 |
35 |
36 |
37 |
38 |
80 |
81 |
82 |
83 |
--------------------------------------------------------------------------------
/examples/css/style.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: 'Roboto', sans-serif;
3 | background-color: #3a3a3a;
4 | color: #e6e6e6;
5 | font-size: large;
6 | margin: 10px 20vw 0 20vw;
7 | }
8 |
9 | canvas,
10 | img {
11 | margin: 10px 0 10px 0;
12 | width: 60vw;
13 | height: auto;
14 | }
15 |
16 | code {
17 | background-color: #676767;
18 | padding: 0px 4px 1px 4px;
19 | border-radius: 3px;
20 | font-family: monospace;
21 | }
22 |
23 | a{
24 | text-decoration: none;
25 | color: #ff91d7;
26 | transition: all 0.2s;
27 | }
28 |
29 | a:hover {
30 | color: #00cbf1;
31 | }
32 |
33 | textarea {
34 | margin-top: 10px;
35 | width: 100%;
36 | }
37 |
38 | h1 {
39 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
40 | }
41 |
42 | .canvasDiv{
43 | margin-bottom: 10px;
44 | }
45 |
46 | #chartDiv {
47 | height: 500px;
48 | }
49 |
50 | canvas {
51 | cursor: crosshair;
52 | }
53 |
54 | .white-bg {
55 | background-color: white;
56 | }
57 |
58 | .padding-10px {
59 | padding: 10px;
60 | }
61 |
--------------------------------------------------------------------------------
/examples/derivativeImage2D.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Derivative of Image2D
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | This does the following :
13 |
14 | opening a local image file, using pixpipe.FileImageReader
15 | converting it into a pixpipe.Image2D
object
16 | compute the dx and dy derivative with pixpipe.ImageDerivativeFilter
17 | displaying it in a canvas using pixpipe.CanvasImageWriter
18 |
19 |
20 |
21 |
22 |
23 | Select an image file:
24 |
25 |
26 |
27 |
28 |
29 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/examples/fileToArrayBuffer.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | FileToArrayBufferReader to ArrayBuffer
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | This does the following :
13 |
14 | opening a local file, using pixpipe.FileToArrayBufferReader
15 | display the length of the ArrayBuffer in Bytes
16 |
17 |
18 |
19 |
20 |
21 | Select an file:
22 |
23 |
24 |
25 |
26 |
27 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/examples/fileToEDF.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | File to EDF
4 |
5 |
6 |
7 |
8 |
9 |
17 |
18 |
19 |
20 |
21 |
22 | This does the following :
23 |
24 | open a local EDF file, using pixpipe.FileToArrayBufferReader
25 | redirect the file buffer into a pixpipe.EdfDecoder
to extract EDF dataset and metadata
26 | get the output as a string description
27 | Note: open the javascript console where the opbject is printed
28 |
29 |
30 |
31 |
32 |
33 | Select an file:
34 |
35 |
36 |
37 |
38 |
39 |
40 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/examples/fileToGenericImage2D.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | file to Image2D
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | This does the following :
13 |
14 | open a local Jpeg file, using pixpipe.FileToArrayBufferReader
15 | redirect the file buffer into a pixpipe.Image2DGenericDecoder
16 | get the output as a generic pixpipe.Image2D
object
17 | display the image using pixpipe.CanvasImageWriter
18 |
19 |
20 |
21 |
22 |
23 | Select an file:
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/examples/fileToGenericSignal1D.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | File to Signal1D
4 |
5 |
6 |
7 |
8 |
9 |
17 |
18 |
19 |
20 |
21 |
22 | This does the following :
23 |
24 | open a local Signal1D file, using pixpipe.FileToArrayBufferReader
25 | redirect the file buffer into a pixpipe.Signal1DGenericDecoder
to extract dataset and metadata
26 | get the output as a string description
27 | Note: open the javascript console where the opbject is printed
28 |
29 |
30 |
31 |
32 |
33 | Select an file:
34 |
35 |
36 |
37 |
38 |
39 |
40 |
97 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/examples/fileToImage2D.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | File to Image2D
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | This does the following :
13 |
14 | opening a local image file, using pixpipe.FileImageReader
15 | converting it into a pixpipe.Image2D
object
16 | displaying it in a canvas using pixpipe.CanvasImageWriter
17 |
18 |
19 |
20 |
21 |
22 | Select an image file:
23 |
24 |
25 |
26 |
27 |
28 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/examples/fileToJpeg.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | File to Jpeg
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | This does the following :
13 |
14 | open a local Jpeg file, using pixpipe.FileToArrayBufferReader
15 | redirect the file buffer into a pixpipe.JpegDecoder
to extract jpeg dataset and metadata
16 | get the output as a generic pixpipe.Image2D
object
17 | display the image using pixpipe.CanvasImageWriter
18 |
19 |
20 |
21 |
22 |
23 | Select an file:
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/examples/fileToModEeg.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | File to MOD EEG
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | This does the following :
14 |
15 | open a local MOD file (EEG format), using pixpipe.FileToArrayBufferReader
16 | redirect the file buffer into a pixpipe.EegModDecoder
to extract the dataset and metadata
17 |
18 |
19 |
20 |
21 |
22 | Select an file:
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/examples/fileToPng.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | File to Jpeg
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | This does the following :
13 |
14 | open a local Png file, using pixpipe.FileToArrayBufferReader
15 | redirect the file buffer into a pixpipe.PngDecoder
to extract png dataset and metadata
16 | get the output as a generic pixpipe.Image2D
object
17 | display the image using pixpipe.CanvasImageWriter
18 |
19 |
20 |
21 |
22 |
23 | Select an file:
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
83 |
84 |
85 |
86 |
--------------------------------------------------------------------------------
/examples/fileToTiff.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | File to Tiff
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | This does the following :
13 |
14 | open a local tiff file, using pixpipe.FileToArrayBufferReader
15 | redirect the file buffer into a pixpipe.tiffDecoder
to extract tiff dataset and metadata
16 | get the output as a generic pixpipe.Image2D
object
17 | display the image using pixpipe.CanvasImageWriter
18 |
19 |
20 |
21 |
22 |
23 | Select an file:
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/examples/floodFillImage2D.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Flood fill an Image2D
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This does the following :
15 |
16 | opening a distant image file with AJAX request, using pixpipe.UrlImageReader
17 | Paint with flood fill from a seed using pixpipe.FloodFillImageFilter
18 | displaying it in a canvas using pixpipe.CanvasImageWriter
19 |
20 |
21 |
22 |
23 |
24 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/examples/forEachPixel.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | URL to Image2D
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This does the following :
15 |
16 | opening a local image file, using pixpipe.FileImageReader
17 | apply a function to every pixel, using pixpipe.ForEachPixelImageFilter
18 | displaying it in a canvas using pixpipe.CanvasImageWriter
19 |
20 |
21 |
22 |
23 |
24 |
The original image:
25 |
26 |
27 |
28 |
29 |
The transformed image, with switched chanels:
30 |
31 |
32 |
33 |
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/examples/image2DToCanvas.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Image2D To Canvas
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This does the following :
15 |
16 | creating a pixpipe.Image2D
with a given size and color
17 | displaying it in a canvas using pixpipe.CanvasImageWriter
18 |
19 |
20 |
21 |
22 |
23 |
24 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/examples/imageBlending2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Mask and blending
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This does the following :
15 |
16 | opening a distant image (1) file with AJAX request, using pixpipe.UrlImageReader
17 | opening another distant image (2) file with AJAX request, using pixpipe.UrlImageReader
18 | (image 1 and image 2 have the same size and same number of band)
19 | use image 2 as a mask and blend both using a pixpipe.ImageBlendExpressionFilter
20 | displaying the final output in a canvas using pixpipe.CanvasImageWriter
21 |
22 | Note that using a parametric math expression with pixpipe.ImageBlendExpressionFilter
is generally slower.
23 |
24 |
25 |
26 |
The original image and the mask:
27 |
28 |
29 |
30 |
31 |
32 |
The blended image, only the lighter parts of the second images are visible:
33 |
34 |
35 |
36 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/examples/imageThresholding.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Image Thresholding
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This does the following :
15 |
16 | opening a distant image file with AJAX request, using pixpipe.UrlImageReader
17 | Threshold this image wth pixpipe.SimpleThresholdFilter
18 | displaying it in a canvas using pixpipe.CanvasImageWriter
19 |
20 |
21 |
22 |
23 |
24 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/examples/images/githubLogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/examples/images/githubLogo.png
--------------------------------------------------------------------------------
/examples/images/mask.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/examples/images/mask.png
--------------------------------------------------------------------------------
/examples/images/ny1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/examples/images/ny1.jpg
--------------------------------------------------------------------------------
/examples/images/ny2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/examples/images/ny2.jpg
--------------------------------------------------------------------------------
/examples/images/org_logo_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/examples/images/org_logo_512.png
--------------------------------------------------------------------------------
/examples/images/portrait1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/examples/images/portrait1.jpg
--------------------------------------------------------------------------------
/examples/images/portrait2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/examples/images/portrait2.jpg
--------------------------------------------------------------------------------
/examples/images/portrait3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/examples/images/portrait3.jpg
--------------------------------------------------------------------------------
/examples/images/prefix_001_gray_surface.obj.gz:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/examples/images/prefix_001_gray_surface.obj.gz
--------------------------------------------------------------------------------
/examples/images/sd.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/examples/images/sd.jpg
--------------------------------------------------------------------------------
/examples/images/sd.pixp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/examples/images/sd.pixp
--------------------------------------------------------------------------------
/examples/images/segmentedBrain.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/examples/images/segmentedBrain.png
--------------------------------------------------------------------------------
/examples/multiFileToMultiImage2D.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Multiple Image2D
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | This does the following :
13 |
14 | opening a local image file, using pixpipe.FileToArrayBufferReader
15 | redirect the file buffer into a pixpipe.Image2DGenericDecoder
16 | get the output as a generic pixpipe.Image2D
object
17 | display the image using pixpipe.CanvasImageWriter
18 |
19 |
20 |
21 |
22 |
23 | Select an file:
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
86 |
87 |
88 |
89 |
--------------------------------------------------------------------------------
/examples/multiplyImage2D.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Multiply Image2D
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This does the following :
15 |
16 | opening a distant image file with AJAX request, using pixpipe.UrlImageReader
17 | creating a weight pixpipe.Image2D
of the same size
18 | multiplying the two with pixpipe.MultiplyImageFilter
19 | displaying the result in a canvas using pixpipe.CanvasImageWriter
20 |
21 |
22 |
23 |
24 |
25 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/examples/nearestSparseInterpolation.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Image2D To Canvas
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This does the following :
15 |
16 | creating a set of random (sparse) points with random values
17 | Interpolate them using pixpipe.NearestNeighborSparseInterpolationImageFilter
18 | displaying the output image with a pixpipe.CanvasImageWriter
19 |
20 |
21 |
22 |
23 |
24 |
25 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/examples/nniColormap.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Apply Colormap
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This does the following :
15 |
16 | creating a set of random (sparse) points with random values
17 | Interpolate them using pixpipe.NaturalNeighborSparseInterpolationImageFilter
18 | Running a pixpipe.ApplyColormapFilter
on the nni result
19 | displaying the output image with a pixpipe.CanvasImageWriter
20 |
21 |
22 |
23 |
24 |
25 |
26 |
75 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/examples/patchImage2D.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Image2D To Canvas
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This does the following :
15 |
16 | creating a pixpipe.Image2D
with a given size and color
17 | displaying it in a canvas using pixpipe.CanvasImageWriter
18 |
19 |
20 |
21 |
22 |
23 |
24 |
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/examples/photoColorMap.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Photo with colormap
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This does the following :
15 |
16 | opening a distant image file with AJAX request, using pixpipe.UrlImageReader
17 | Running a pixpipe.ApplyColormapFilter
on the nni result
18 | displaying it in a canvas using pixpipe.CanvasImageWriter
19 |
20 | The colormap chosen here is "inferno" on the 2nd component of the image (not clustered, not flipped)
21 |
22 |
23 |
24 |
25 |
26 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/examples/pixpFileToImage2D.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | UrlFileToArrayBufferReader to ArrayBuffer
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | This does the following :
13 |
14 | opening distant *.pixp
file, using pixpipe.UrlToArrayBufferReader
15 | decode the *.pixp
as an Image2D using pixpipe.PixpDecoder
16 | displaying the Image2D in a canvas using pixpipe.CanvasImageWriter
17 |
18 |
19 |
20 |
21 |
22 |
23 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/examples/terrainRgbToElevation.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | TerrainRGB to elevation image
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | This does the following :
13 |
14 | opening a local TerrainRGB png image, using pixpipe.FileImageReader
15 | converting it into a pixpipe.Image2D
object
16 | compute the elevation map with pixpipe.TerrainRgbToElevationImageFilter
object
17 | display it in a canvas using pixpipe.CanvasImageWriter
18 |
19 |
20 | To know more about the TerrainRGB image format, read Mapbox's article .
21 |
22 |
23 |
24 | Select an image file:
25 |
26 |
27 |
28 |
29 |
30 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/examples/urlFileToArrayBuffer.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | UrlFileToArrayBufferReader to ArrayBuffer
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | This does the following :
13 |
14 | opening distant files, using pixpipe.UrlToArrayBufferReader
15 | display the length of the ArrayBuffers in Bytes
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/examples/urlFileToTextFile.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Url to text filer
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | This does the following :
13 |
14 | opening distant text files, using pixpipe.UrlToArrayBufferReader
15 | enabling the readAsText
metadata
16 | display the length of the string
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/examples/urlToImage2D.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | URL to Image2D
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This does the following :
15 |
16 | opening a distant image file with AJAX request, using pixpipe.UrlImageReader
17 | displaying it in a canvas using pixpipe.CanvasImageWriter
18 |
19 |
20 |
21 |
22 |
23 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/examples/urlToImage2D_multiple.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | URL to Image2D
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 | This does the following :
15 |
16 | opening several distant image files with AJAX request, using a single pixpipe.UrlImageReader
instance
17 | displaying them in a canvas using pixpipe.CanvasImageWriter
18 |
19 |
20 |
21 |
22 |
23 |
24 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/examples_node/createImage2D.js:
--------------------------------------------------------------------------------
1 | const pixpipe = require('..');
2 |
3 | // create an image
4 | var myImage = new pixpipe.Image2D({width: 100, height: 50, color: [255, 128, 64, 255]})
5 | console.log(myImage);
6 |
--------------------------------------------------------------------------------
/header.txt:
--------------------------------------------------------------------------------
1 | /*
2 | * Author Jonathan Lurie - http://me.jonathanlurie.fr
3 | * License MIT
4 | * Link https://github.com/Pixpipe/pixpipejs
5 | * Lab MCIN - Montreal Neurological Institute
6 | */
7 |
--------------------------------------------------------------------------------
/images/pixpipe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/images/pixpipe.png
--------------------------------------------------------------------------------
/images/pixpipe256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Pixpipe/pixpipejs/1bfd256bf441d94d740e20bd60ced97cc39cf6e6/images/pixpipe256.png
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pixpipe",
3 | "version": "0.2.0",
4 | "description": "A image processing pipeline in pure Javascript for browsers and Node",
5 | "entry": "src/pixpipe.js",
6 | "main": "dist/pixpipe.js",
7 | "min": "dist/pixpipe.min.js",
8 | "es6": "dist/pixpipe.es6.js",
9 | "esmodule": "dist/pixpipe.esmodule.js",
10 | "scripts": {
11 | "test": "echo \"Error: no test specified\" && exit 1",
12 | "build": "rollup -c",
13 | "dev": "serve -l 5678 . & rollup -w -c rollup.config.dev.js",
14 | "doc": "node ./docgen/ConfigGenerator.js; documentation build src/pixpipe.js --format html --sort-order 'alpha' --project-name Pixpipejs --config ./docgen/config.yml --theme ./docgen/themes/pixpipe_theme/ -o ./doc/"
15 | },
16 | "repository": {
17 | "type": "git",
18 | "url": "git+https://github.com/Pixpipe/pixpipejs.git"
19 | },
20 | "keywords": [
21 | "image",
22 | "processing",
23 | "MRI",
24 | "fMRI",
25 | "EEG",
26 | "signal",
27 | "math",
28 | "browser",
29 | "node",
30 | "javascript",
31 | "web"
32 | ],
33 | "author": "Jonathan Lurie",
34 | "license": "MIT",
35 | "bugs": {
36 | "url": "https://github.com/Pixpipe/pixpipejs/issues"
37 | },
38 | "homepage": "https://github.com/Pixpipe/pixpipejs#readme",
39 | "devDependencies": {
40 | "babel-core": "^6.26.0",
41 | "babel-plugin-external-helpers": "^6.22.0",
42 | "babel-preset-es2015-rollup": "^3.0.0",
43 | "bvh-tree-plus": "^1.0.2",
44 | "codecutils": "^0.1.1",
45 | "delaunay-fast": "^1.0.1",
46 | "differenceequationsignal1d": "^0.1.1",
47 | "documentation": "^6.1.0",
48 | "edfdecoder": "^0.1.1",
49 | "expr-eval": "^1.0.0",
50 | "file-saver": "^1.3.3",
51 | "geotiff": "^0.4.1",
52 | "gl-matrix": "^2.4.0",
53 | "google-closure-compiler-js": "^20180204.0.0",
54 | "joi-browser": "^10.6.1",
55 | "jpeg-js": "^0.3.3",
56 | "js-md5": "^0.7.3",
57 | "mniobjparser": "^0.1.2",
58 | "natninter": "^0.1.3",
59 | "ndarray": "^1.0.18",
60 | "ndarray-fft": "^1.0.3",
61 | "nifti-reader-js": "^0.5.4",
62 | "pako": "^1.0.6",
63 | "pixbincodec": "^0.1.2",
64 | "process": "^0.11.10",
65 | "qeegmodfile": "^0.1.3",
66 | "rollup": "^0.57.1",
67 | "rollup-plugin-babel": "^3.0.3",
68 | "rollup-plugin-bundle-worker": "^0.1.0",
69 | "rollup-plugin-commonjs": "^9.1.0",
70 | "rollup-plugin-node-builtins": "^2.1.2",
71 | "rollup-plugin-node-globals": "^1.2.0",
72 | "rollup-plugin-node-resolve": "^3.3.0",
73 | "rollup-plugin-uglify": "^3.0.0",
74 | "serve": "^6.3.1",
75 | "simplify-js": "^1.2.1",
76 | "upng-js": "^1.0.0",
77 | "yamljs": "^0.3.0",
78 | "zeros": "^1.0.0"
79 | },
80 | "dependencies": {}
81 | }
82 |
--------------------------------------------------------------------------------
/pipeline.md:
--------------------------------------------------------------------------------
1 | # Pipeline
2 |
3 | Pipeline.js acthitecture is somewhat inspired by ITK architecture, applied to Javascript. The two main kind of components are:
4 | - Image: stores the image data
5 | - Filter: takes one or more Image objects as input, gives one or more Image object in output. Apply some processing in between.
6 | - Streamer, used for reading or writing data. They are like filter except they or only give an output (reader) or only take an input (writer).
7 |
8 | Unless an image is explicitly initialized using a constructor with options of size or using the `copy()` method, instance of Images must always be created by a teamer or a filer internaly.
9 |
--------------------------------------------------------------------------------
/rollup.config.dev.js:
--------------------------------------------------------------------------------
1 | var pkg = require('./package.json');
2 |
3 | /*
4 | The dev version of the Rollup pkg does not transpile to ES5
5 | and outputs a single umd package.
6 | */
7 |
8 | import commonjs from 'rollup-plugin-commonjs';
9 | import nodeResolve from 'rollup-plugin-node-resolve';
10 | //import bundleWorker from 'rollup-plugin-bundle-worker';
11 | import builtins from 'rollup-plugin-node-builtins';
12 | import globals from 'rollup-plugin-node-globals';
13 |
14 |
15 | export default [
16 | {
17 | input: pkg.entry,
18 | output: {
19 | file: pkg.main,
20 | name: pkg.name,
21 | sourcemap: true,
22 | format: 'umd'
23 | },
24 |
25 | plugins: [
26 | nodeResolve({
27 | preferBuiltins: false
28 | }),
29 | commonjs(),
30 | //bundleWorker(),
31 | globals(),
32 | builtins()
33 | ]
34 | }
35 |
36 | ];
37 |
--------------------------------------------------------------------------------
/rollup.config.js:
--------------------------------------------------------------------------------
1 | var pkg = require('./package.json');
2 |
3 | import babel from 'rollup-plugin-babel';
4 | import commonjs from 'rollup-plugin-commonjs';
5 | import nodeResolve from 'rollup-plugin-node-resolve';
6 | import builtins from 'rollup-plugin-node-builtins';
7 | import globals from 'rollup-plugin-node-globals';
8 | import uglify from 'rollup-plugin-uglify';
9 |
10 |
11 | export default [
12 |
13 | // Default 'main' bundle
14 | // UMD + ES5 (transpiled from ES6 using Babel)
15 | {
16 | input: pkg.entry,
17 | output: {
18 | file: pkg.main,
19 | sourcemap: true,
20 | name: pkg.name,
21 | format: 'umd'
22 | },
23 |
24 | plugins: [
25 | nodeResolve({
26 | preferBuiltins: false
27 | }),
28 | commonjs(),
29 | globals(),
30 | builtins(),
31 | babel({
32 | babelrc: false,
33 | presets: [ 'es2015-rollup' ]
34 | })
35 | ]
36 | },
37 |
38 |
39 | // UMD + ES5 + min (transpiled from ES6 using Babel)
40 | {
41 | input: pkg.entry,
42 | output: {
43 | file: pkg.min,
44 | sourcemap: false,
45 | name: pkg.name,
46 | format: 'umd'
47 | },
48 |
49 | plugins: [
50 | nodeResolve({
51 | preferBuiltins: false
52 | }),
53 | commonjs(),
54 | globals(),
55 | builtins(),
56 | babel({
57 | babelrc: false,
58 | presets: [ 'es2015-rollup' ]
59 | }),
60 |
61 | uglify()
62 | ]
63 | },
64 |
65 | // UMD + ES6
66 | {
67 | input: pkg.entry,
68 | output: {
69 | file: pkg.es6,
70 | name: pkg.name,
71 | sourcemap: true,
72 | format: 'umd'
73 | },
74 |
75 | plugins: [
76 | nodeResolve({
77 | preferBuiltins: false
78 | }),
79 | commonjs(),
80 | globals(),
81 | builtins()
82 | ]
83 | },
84 |
85 | // ESMODULE + ES6
86 | {
87 | input: pkg.entry,
88 | output: {
89 | file: pkg.esmodule,
90 | name: pkg.name,
91 | sourcemap: true,
92 | format: 'es'
93 | },
94 |
95 | plugins: [
96 | nodeResolve({
97 | preferBuiltins: false
98 | }),
99 | commonjs(),
100 | globals(),
101 | builtins()
102 | ]
103 | }
104 |
105 | ];
106 |
--------------------------------------------------------------------------------
/src/core/CoreTypes.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Author Jonathan Lurie - http://me.jonathanlurie.fr
3 | * License MIT
4 | * Link https://github.com/Pixpipe/pixpipejs
5 | * Lab MCIN - Montreal Neurological Institute
6 | */
7 |
8 |
9 | // The index types are stored in this sort-of-private/sort-of-static object.
10 | var coreTypes = {}
11 |
12 | /**
13 | * CoreTypes is bit of an exception in Pixpipejs because it does not inherit from
14 | * PixpipeObject and it contains only static methods. In a sens, it's comparable
15 | * to a singleton that stores all the core types constructors of Pixpipe so that
16 | * they can be retrived only by querying their name.
17 | *
18 | * At the creation of a new type, the static method `.addCoreType()` should be
19 | * called right after the closing curly bracket of the class declaration.
20 | * This is if we want to reference this class as a core type.
21 | */
22 | class CoreTypes {
23 |
24 | /**
25 | * [STATIC]
26 | * Adds a new type to the collection of core types. This is used when we want
27 | * to retrieve a type and instanciate an object of this type using its constructor name.
28 | * @param {Class} typeClass - the class of the type
29 | */
30 | static addCoreType( typeClass ){
31 | if( typeof typeClass === "function" ){
32 | coreTypes[ typeClass.name ] = typeClass
33 | }
34 | }
35 |
36 |
37 | /**
38 | * [STATIC]
39 | * Return the constructor of the given type name. This is useful to instanciate
40 | * an object based on the name of its type (eg. in PixBinDecoder)
41 | * @param {String} typeName - the name of the type eg. "Image2D"
42 | * @return {Function} constructor for the given type
43 | */
44 | static getCoreType( typeName ){
45 | if( typeName in coreTypes ){
46 | return coreTypes[ typeName ]
47 | }else{
48 | return null;
49 | }
50 | }
51 |
52 | }
53 |
54 | export { CoreTypes }
55 |
--------------------------------------------------------------------------------
/src/core/ImageToImageFilter.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Author Jonathan Lurie - http://me.jonathanlurie.fr
3 | * License MIT
4 | * Link https://github.com/Pixpipe/pixpipejs
5 | * Lab MCIN - Montreal Neurological Institute
6 | */
7 |
8 | import { Filter } from './Filter.js';
9 | import { Image2D } from './Image2D.js';
10 |
11 | /**
12 | * ImageToImageFilter is not to be used as-is but rather as a base class for any
13 | * filter that input a single Image2D and output a single Image2D.
14 | * This class does not overload the update() method.
15 | */
16 | class ImageToImageFilter extends Filter {
17 |
18 | constructor(){
19 | super();
20 | }
21 |
22 |
23 | /**
24 | * Check if all input image have the same size.
25 | * @return {Boolean} true is same size, false if not.
26 | */
27 | hasSameSizeInput(){
28 | var that = this;
29 | var inputCategories = Object.keys( this._input );
30 | var sameSize = true;
31 |
32 | var widths = [];
33 | var heights = [];
34 |
35 | inputCategories.forEach( function(key){
36 | widths.push( that._getInput( key ).getWidth() );
37 | heights.push( that._getInput( key ).getHeight() );
38 | });
39 |
40 | // if all input have the same size
41 | if(widths.length){
42 | widths.sort();
43 | heights.sort();
44 | sameSize = (widths[ 0 ] == widths[ widths.length -1 ] ) &&
45 | (heights[ 0 ] == heights[ heights.length -1 ] );
46 |
47 | if( !sameSize ){
48 | console.warn("Input image do not all have the same size. Filter not valid");
49 | }
50 | }
51 |
52 | return sameSize;
53 | }
54 |
55 |
56 | /**
57 | * Check if all the inputs have the same number of component per pixel.
58 | * @return {Boolean} true if the ncpp are the same for all input image
59 | */
60 | hasSameNcppInput(){
61 | var inputCategories = Object.keys( this._input );
62 |
63 | // if no input, return false
64 | if(!inputCategories.length)
65 | return false;
66 |
67 | var ncpp = this._getInput( inputCategories[0] ).getComponentsPerPixel();
68 |
69 | for(var i=0; i i.getMetadata('width'));
16 | const widthsEqual = widths.reduce((eq, w) => eq && w === widths[0], true);
17 | if (!widthsEqual) {
18 | return false;
19 | }
20 | const heights = inputImages.map(i => i.getMetadata('height'));
21 | const heightsEqual = heights.reduce((eq, h) => eq && h === heights[0], true);
22 | if (!heightsEqual) {
23 | return false;
24 | }
25 | const types = inputImages.map(i => i.getData().constructor);
26 | const typesEqual = types.reduce((eq, t) => eq && t === types[0], true);
27 | if (!typesEqual) {
28 | return false;
29 | }
30 | return true;
31 | }
32 |
33 | class ComponentMergeImage2DFilter extends Filter {
34 | constructor() {
35 | super();
36 | this.addInputValidator('ALL', Image2D);
37 | }
38 | _run() {
39 | if(this.getNumberOfInputs() < 2) {
40 | console.warn('A filter of type ComponentMergeImage2DFilter needs 2 or more inputs.');
41 | return;
42 | }
43 | if( ! this.hasValidInput()){
44 | console.warn("A filter of type ComponentMergeImage2DFilter requires inputs of Image2D.");
45 | return;
46 | }
47 | const inputImages = this.getInputCategories().map(cat => this._getInput(cat));
48 | if (!validateInputs(inputImages)) {
49 | console.warn('A filter of type ComponentMergeImage2DFilter requires inputs to be the same dimensions and array type');
50 | return;
51 | };
52 | const width = inputImages[0].getMetadata('width');
53 | const height = inputImages[0].getMetadata('height');
54 | const ncpps = inputImages.map(i => i.getMetadata('ncpp'));
55 | const totalncpp = ncpps.reduce((x,y) => x + y);
56 | const type = ndarray(inputImages[0].getData()).dtype;
57 | const merged = zeros([width, height, totalncpp], type);
58 |
59 | let ncppoffset = 0;
60 | inputImages.forEach((image, index) => {
61 | const ncpp = image.getMetadata('ncpp');
62 | const img = ndarray(image.getData(), [width, height, ncpp]);
63 | for (let i = 0; i < width; i++) {
64 | for (let j = 0; j < height; j++) {
65 | for (let k = 0; k < ncpp; k++) {
66 | merged.set(i, j, ncppoffset + k, img.get(i, j, k));
67 | }
68 | }
69 | }
70 | ncppoffset += ncpp;
71 | });
72 | this._output[0] = new Image2D();
73 | this._output[0].setData(merged.data, width, height, totalncpp);
74 | }
75 | }
76 |
77 | export { ComponentMergeImage2DFilter };
78 |
--------------------------------------------------------------------------------
/src/filter/ComponentProjectionImage2DFilter.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Author Armin Taheri - https://github.com/ArminTaheri
3 | * License MIT
4 | * Link https://github.com/Pixpipe/pixpipejs
5 | * Lab MCIN - Montreal Neurological Institute
6 | */
7 |
8 | import ndarray from 'ndarray';
9 | import zeros from 'zeros';
10 | import { Filter } from '../core/Filter';
11 | import { Image2D } from '../core/Image2D';
12 |
13 | class ComponentProjectionImage2DFilter extends Filter {
14 | constructor() {
15 | super();
16 | this.addInputValidator(0, Image2D);
17 | this.setMetadata('componentOffset', 0);
18 | }
19 |
20 |
21 | _run() {
22 | if( ! this.hasValidInput()){
23 | console.warn("A filter of type ComponentProjectionImage2DFilter requires 1 input of Image2D.");
24 | return;
25 | }
26 | const inputSignal = this._getInput(0);
27 | const width = inputSignal.getMetadata('width');
28 | const height = inputSignal.getMetadata('height');
29 | const ncpp = inputSignal.getMetadata('ncpp');
30 | const offset = this.getMetadata('componentOffset');
31 | const arr = ndarray(inputSignal.getData(), [width, height, ncpp]);
32 | const projected = arr.pick(null, null, offset); // pick out the component as an ndarray
33 | const projectedArray = zeros([width, height], arr.dtype);
34 | for (let i = 0; i < width; i++) {
35 | for (let j = 0; j < height; j++) {
36 | projectedArray.set(i, j, projected.get(i, j));
37 | }
38 | }
39 | const projectedImage = new Image2D();
40 | projectedImage.setData(projectedArray.data, width, height, 1);
41 | this._output[0] = projectedImage;
42 | }
43 |
44 | }
45 |
46 | export { ComponentProjectionImage2DFilter };
47 |
--------------------------------------------------------------------------------
/src/filter/CropImageFilter.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Author Jonathan Lurie - http://me.jonathanlurie.fr
3 | * License MIT
4 | * Link https://github.com/Pixpipe/pixpipejs
5 | * Lab MCIN - Montreal Neurological Institute
6 | */
7 |
8 | import { Image2D } from '../core/Image2D.js';
9 | import { ImageToImageFilter } from '../core/ImageToImageFilter.js';
10 |
11 | /**
12 | * An instance of CropImageFilter is used to crop an `Image2D`. This filter accepts
13 | * a single input, using `.addInput( myImage )`, then, it requires a top left point
14 | * that must be set with `.setMetadata( "x", Number)` and `.setMetadata( "y", Number)`.
15 | * In addition, you must specify the width and heigth of the output using
16 | * `.setMetadata( "w", Number)` and `.setMetadata( "h", Number)`.
17 | *
18 | * **Usage**
19 | * - [examples/cropImage2D.html](../examples/cropImage2D.html)
20 | *
21 | */
22 | class CropImageFilter extends ImageToImageFilter {
23 | constructor(){
24 | super();
25 | this.addInputValidator(0, Image2D);
26 |
27 | this.setMetadata( "x", 0 );
28 | this.setMetadata( "y", 0 );
29 | this.setMetadata( "w", 0 );
30 | this.setMetadata( "h", 0 );
31 | }
32 |
33 |
34 | _run(){
35 | if( ! this.hasValidInput()){
36 | console.warn("A filter of type CropImageFilter requires 1 input of category '0' (Image2D)");
37 | return;
38 | }
39 |
40 | var startX = Math.round( this.getMetadata( "x" ) );
41 | var startY = Math.round(this.getMetadata( "y" ) );
42 | var outW = Math.round(this.getMetadata( "w" ) );
43 | var outH = Math.round(this.getMetadata( "h" ) );
44 | var endX = startX + outW;
45 | var endY = startY + outH;
46 |
47 | var inputImage = this._getInput( 0 );
48 | var inputWidth = inputImage.getWidth();
49 | var inputHeight = inputImage.getHeight();
50 | var ncpp = inputImage.getNcpp();
51 |
52 | if( startX < 0 || startY < 0 || startX >= inputWidth || startY >= inputHeight ||
53 | endX < 0 || endY < 0 || endX >= inputWidth || endY >= inputHeight){
54 | console.warn("The query area is out of bound");
55 | return;
56 | }
57 |
58 | var inputData = inputImage.getData();
59 |
60 | var outputImage = new Image2D({
61 | width : outW,
62 | height : outH,
63 | color : new inputData.constructor( ncpp )
64 | })
65 |
66 | for( var i=0; i samplingFreq/2 ){
44 | console.warn("The cutoff frequency cannot be greater than half of the sampling frequency (cf. Nyquist).");
45 | return;
46 | }
47 |
48 | var lowPassSignal1D = new LowPassSignal1D();
49 | lowPassSignal1D.setMetadata("cutoffFrequency", cutoffFreq);
50 | lowPassSignal1D.setMetadata("filterType", filterType);
51 | lowPassSignal1D.setMetadata("gaussianTolerance", gaussianTolerance);
52 | lowPassSignal1D.addInput( input );
53 | lowPassSignal1D.update();
54 |
55 | var loPassSignal = lowPassSignal1D.getOutput();
56 |
57 | if( !loPassSignal ){
58 | console.warn("couldnt compute the low pass filter.");
59 | return;
60 | }
61 |
62 | var out = input.clone();
63 | var outData = out.getData();
64 | var loPassData = loPassSignal.getData();
65 |
66 | for(var i=0; i samplingFreq/2 ){
46 | console.warn("The cutoff frequency cannot be greater than half of the sampling frequency (cf. Nyquist).");
47 | return;
48 | }
49 |
50 | // compute the Fourier Transform of the signal
51 | var phaseHollow = input.hollowClone()
52 | var forwardFtfilter = new ForwardFourierSignalFilter();
53 | forwardFtfilter.addInput(input, 0);
54 | forwardFtfilter.addInput(phaseHollow, 1);
55 | forwardFtfilter.update();
56 |
57 | var signalFreq = {
58 | real: forwardFtfilter.getOutput(0),
59 | imag: forwardFtfilter.getOutput(1)
60 | }
61 |
62 | // compute the lo-pass in freq domain
63 | var freqLoPassFilter = new LowPassFreqSignal1D();
64 | freqLoPassFilter.addInput( signalFreq.real, "real" );
65 | freqLoPassFilter.addInput( signalFreq.imag, "imaginary" );
66 | freqLoPassFilter.setMetadata("filterType", filterType);
67 | freqLoPassFilter.setMetadata("cutoffFrequency", cutoffFreq);
68 | freqLoPassFilter.setMetadata("gaussianTolerance", gaussianTolerance);
69 | freqLoPassFilter.update();
70 |
71 | var signalFreqLoPass = {
72 | real: freqLoPassFilter.getOutput("real"),
73 | imag: freqLoPassFilter.getOutput("imaginary")
74 | }
75 |
76 | // inverse Fourier transform
77 | var ifftfilter = new pixpipe.InverseFourierSignalFilter();
78 | ifftfilter.addInput(signalFreqLoPass.real, 0);
79 | ifftfilter.addInput(signalFreqLoPass.imag, 1);
80 | ifftfilter.update();
81 |
82 | var out = ifftfilter.getOutput();
83 |
84 | if( out ){
85 | this._output[0] = out;
86 | }
87 |
88 | }
89 |
90 | } /* END of class LowPassSignal1D */
91 |
92 | export { LowPassSignal1D };
93 |
--------------------------------------------------------------------------------
/src/filter/MultiplyImageFilter.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Author Jonathan Lurie - http://me.jonathanlurie.fr
3 | * License MIT
4 | * Link https://github.com/Pixpipe/pixpipejs
5 | * Lab MCIN - Montreal Neurological Institute
6 | */
7 |
8 |
9 | import { Image2D } from '../core/Image2D.js';
10 | import { ImageToImageFilter } from '../core/ImageToImageFilter.js';
11 |
12 |
13 | /**
14 | * Multiply two Image2D pixel by pixel. They must have the same number of components per pixel
15 | * and the same size.
16 | * Output an new Image3D.
17 | * Equivalent to `SpectralScaleImageFilter`.
18 | *
19 | * **Usage**
20 | * - [examples/multiplyImage2D.html](../examples/multiplyImage2D.html)
21 | *
22 | */
23 | class MultiplyImageFilter extends ImageToImageFilter {
24 |
25 | constructor(){
26 | super();
27 | this.addInputValidator(0, Image2D);
28 | this.addInputValidator(1, Image2D);
29 | }
30 |
31 |
32 | _run(){
33 |
34 | // the input checking
35 | if( ! this.hasValidInput()){
36 | console.warn("A filter of type MultiplyImageFilter requires 1 input of category '0' and one input of category '1'.");
37 | return;
38 | }
39 |
40 | if( !this.hasSameNcppInput() || !this.hasSameSizeInput() ){
41 | return;
42 | }
43 |
44 |
45 | var img0 = this._getInput( 0 );
46 | var img1 = this._getInput( 1 );
47 |
48 |
49 | var img1Buffer = img1.getData();
50 | var outputBuffer = img0.getDataCopy();
51 |
52 | for(var i=0; i onlyAbove){
32 | if(!hasStarted){
33 | actualBegin = x;
34 | hasStarted = true;
35 | }
36 | g.push( gx );
37 | actualEnd = x;
38 | }else{
39 | if(hasStarted){
40 | break;
41 | }
42 | }
43 | }
44 |
45 | return {
46 | data: new Float32Array( g ),
47 | actualBegin: actualBegin,
48 | actualEnd: actualEnd
49 | }
50 | }
51 |
52 |
53 | /**
54 | * Get the value of the gaussian given a x and a sigma (standard deviation).
55 | * Note that this gaussian is the one use in a frequency response. If you look
56 | * for the gaussian as an impulse response, check the method
57 | * `gaussianImpulseResponseSingle`.
58 | * @param {Number} sigma - the standard deviation (or cutoff frequency)
59 | * @param {Number} x - the abscisse
60 | * @return {Number} the gaussian value at x for the given sigma
61 | */
62 | static gaussianFrequencyResponseSingle( sigma, x ){
63 | return Math.exp( -( (x*x) / (2*sigma*sigma) ) );
64 | }
65 |
66 |
67 |
68 | } /* END of class FunctionGenerator */
69 |
70 | export { FunctionGenerator };
71 |
--------------------------------------------------------------------------------
/src/utils/readme.md:
--------------------------------------------------------------------------------
1 | The Utils are usually not respecting the inheritance schema provided by Pixpipe because they are neither data structure, nor filters. They just provide some small feature that can be used by multiple `PixpipeObject`s.
2 |
--------------------------------------------------------------------------------