Skip to content

Commit

Permalink
Merge branch 'master' into feature/replaceToolState
Browse files Browse the repository at this point in the history
  • Loading branch information
mix3d authored Jul 29, 2021
2 parents c2870fc + fae1bed commit 8d114b3
Show file tree
Hide file tree
Showing 71 changed files with 48 additions and 22 deletions.
30 changes: 24 additions & 6 deletions .circleci/update-docs.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,27 @@ cd "$(dirname "$0")"
## Generate DOCMA API Docs
cd ..
npm run docs:api
cd ./.circleci/

# Try to patch Gitbook's broken deep dependency on graceful-fs
npm install --save gitbook-cli
cd node_modules/gitbook-cli/node_modules/npm
npm install [email protected] --save
cd ../../
./bin/gitbook.js fetch
cd ../../

# Generate latest output
# Clear previous output, generate new
cd ./docs/latest
rm -rf _book
../../node_modules/gitbook-cli/bin/gitbook.js install
../../node_modules/gitbook-cli/bin/gitbook.js build
cd ../../


# Generate all version's GitBook output
# For each directory in /docs ...
cd ./../docs/
cd ./docs/previous
for D in *; do
if [ -d "${D}" ]; then

Expand All @@ -21,12 +36,13 @@ for D in *; do

# Clear previous output, generate new
rm -rf _book
gitbook install
gitbook build
../../../node_modules/gitbook-cli/bin/gitbook.js install
../../../node_modules/gitbook-cli/bin/gitbook.js build

cd ..
fi
done
cd ..

# Move CNAME File into `latest`
cp CNAME ./latest/CNAME
Expand All @@ -35,16 +51,18 @@ cp CNAME ./latest/CNAME
mkdir ./latest/_book/history

# Move each version's files to latest's history folder
cd previous
for D in *; do
if [ -d "${D}" ]; then

echo "Moving ${D} to the latest version's history folder"

mkdir "./latest/_book/history/${D}"
cp -v -r "./${D}/_book"/* "./latest/_book/history/${D}"
mkdir "../latest/_book/history/${D}"
cp -v -r "./${D}/_book"/* "../latest/_book/history/${D}"

fi
done
cd ..

# Generate Examples
cd ./../examples/
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ Thanks goes to these people ([emoji key][emojis]):
| [<img src="https://avatars3.githubusercontent.com/u/3358381?v=4" width="100px;" alt="Juan Narvaez"/><br /><sub><b>Juan Narvaez</b></sub>](https://github.com/jdnarvaez)<br />[💻](https://github.com/cornerstonejs/cornerstoneTools/commits?author=jdnarvaez "Code") | [<img src="https://avatars0.githubusercontent.com/u/814227?v=4" width="100px;" alt="Mike"/><br /><sub><b>Mike</b></sub>](https://github.com/mikehazell)<br />[📖](https://github.com/cornerstonejs/cornerstoneTools/commits?author=mikehazell "Documentation") [💻](https://github.com/cornerstonejs/cornerstoneTools/commits?author=mikehazell "Code") [⚠️](https://github.com/cornerstonejs/cornerstoneTools/commits?author=mikehazell "Tests") | [<img src="https://avatars2.githubusercontent.com/u/3329885?v=4" width="100px;" alt="Sangkeun Kim"/><br /><sub><b>Sangkeun Kim</b></sub>](http://sisobus.com)<br />[💻](https://github.com/cornerstonejs/cornerstoneTools/commits?author=sisobus "Code") [💬](#question-sisobus "Answering Questions") | [<img src="https://avatars3.githubusercontent.com/u/378021?v=4" width="100px;" alt="Victor Saase"/><br /><sub><b>Victor Saase</b></sub>](https://github.com/vsaase)<br />[🤔](#ideas-vsaase "Ideas, Planning, & Feedback") | [<img src="https://avatars2.githubusercontent.com/u/120943?v=4" width="100px;" alt="Michael Wasser"/><br /><sub><b>Michael Wasser</b></sub>](http://www.mikewasser.com)<br />[📖](https://github.com/cornerstonejs/cornerstoneTools/commits?author=untoldone "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/11068601?v=4" width="100px;" alt="Amandeep Singh"/><br /><sub><b>Amandeep Singh</b></sub>](https://github.com/singhArmani)<br />[🖋](#content-singhArmani "Content") | [<img src="https://avatars0.githubusercontent.com/u/1474137?v=4" width="100px;" alt="Madison Dickson"/><br /><sub><b>Madison Dickson</b></sub>](http://mix3dstudios.com)<br />[📖](https://github.com/cornerstonejs/cornerstoneTools/commits?author=mix3d "Documentation") |
| [<img src="https://avatars1.githubusercontent.com/u/3342530?v=4" width="100px;" alt="Kevin Lee Drum"/><br /><sub><b>Kevin Lee Drum</b></sub>](https://github.com/kevinleedrum)<br />[💻](https://github.com/cornerstonejs/cornerstoneTools/commits?author=kevinleedrum "Code") | [<img src="https://avatars3.githubusercontent.com/u/11224291?v=4" width="100px;" alt="Makarand Bauskar"/><br /><sub><b>Makarand Bauskar</b></sub>](https://github.com/mmbauskar)<br />[💻](https://github.com/cornerstonejs/cornerstoneTools/commits?author=mbauskar "Code") | [<img src="https://avatars0.githubusercontent.com/u/1713255?v=4" width="100px;" alt="Biharck Araujo"/><br /><sub><b>Biharck Araujo</b></sub>](http://www.biharck.com.br)<br />[💡](#example-biharck "Examples") [📖](https://github.com/cornerstonejs/cornerstoneTools/commits?author=biharck "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/5349517?v=4" width="100px;" alt="Devon Bernard"/><br /><sub><b>Devon Bernard</b></sub>](https://www.linkedin.com/in/devonbernard)<br />[📖](https://github.com/cornerstonejs/cornerstoneTools/commits?author=DevonBernard "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/38315992?v=4" width="100px;" alt="Karl-Heinrich"/><br /><sub><b>Karl-Heinrich</b></sub>](https://github.com/Karl-Heinrich)<br />[🐛](https://github.com/cornerstonejs/cornerstoneTools/issues?q=author%3AKarl-Heinrich "Bug reports") [💻](https://github.com/cornerstonejs/cornerstoneTools/commits?author=Karl-Heinrich "Code") [⚠️](https://github.com/cornerstonejs/cornerstoneTools/commits?author=Karl-Heinrich "Tests") | [<img src="https://avatars0.githubusercontent.com/u/15172026?v=4" width="100px;" alt="counterxing"/><br /><sub><b>counterxing</b></sub>](https://blog.xingbofeng.com/)<br />[🐛](https://github.com/cornerstonejs/cornerstoneTools/issues?q=author%3Axingbofeng "Bug reports") [💻](https://github.com/cornerstonejs/cornerstoneTools/commits?author=xingbofeng "Code") | [<img src="https://avatars0.githubusercontent.com/u/50026015?v=4" width="100px;" alt="Jorge Lopes"/><br /><sub><b>Jorge Lopes</b></sub>](https://github.com/jlopes90)<br />[💬](#question-jlopes90 "Answering Questions") |
| [<img src="https://avatars2.githubusercontent.com/u/5546851?v=4" width="100px;" alt="Gabriel Garrido"/><br /><sub><b>Gabriel Garrido</b></sub>](http://garrido.io)<br />[💻](https://github.com/cornerstonejs/cornerstoneTools/commits?author=Ggpsv "Code") | [<img src="https://avatars0.githubusercontent.com/u/4126256?v=4" width="100px;" alt="ASVBPREAUBV"/><br /><sub><b>ASVBPREAUBV</b></sub>](https://github.com/ASVBPREAUBV)<br />[📖](https://github.com/cornerstonejs/cornerstoneTools/commits?author=ASVBPREAUBV "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/50960211?v=4" width="100px;" alt="frolic06"/><br /><sub><b>frolic06</b></sub>](https://github.com/frolic06)<br />[💻](https://github.com/cornerstonejs/cornerstoneTools/commits?author=frolic06 "Code") | [<img src="https://avatars2.githubusercontent.com/u/26968918?v=4" width="100px;" alt="codepage949"/><br /><sub><b>codepage949</b></sub>](https://github.com/codepage949)<br />[💻](https://github.com/cornerstonejs/cornerstoneTools/commits?author=codepage949 "Code") | [<img src="https://avatars.githubusercontent.com/u/1915?v=4" width="100px;" alt="Asherah Connor"/><br /><sub><b>Asherah Connor</b></sub>](https://kivikakk.ee)<br />[💻](https://github.com/cornerstonejs/cornerstoneTools/commits?author=kivikakk "Code") |

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors][all-contributors] specification.
Expand Down
4 changes: 1 addition & 3 deletions docs/latest/book.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"-fontsettings",
"github",
"ga",
"sitemap",
"versions"
],
"pluginsConfig": {
Expand All @@ -26,8 +25,7 @@
},
"versions": {
"gitbookConfigURL": "https://raw.githubusercontent.com/cornerstonejs/cornerstoneTools/master/docs/book.json",
"options": [
{
"options": [{
"value": "https://tools.cornerstonejs.org/history/v2/",
"text": "Version 2.x"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions docs/v2/book.json → docs/previous/v2/book.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"-fontsettings",
"github",
"ga",
"sitemap",
"versions"
],
"pluginsConfig": {
Expand All @@ -26,8 +25,7 @@
},
"versions": {
"gitbookConfigURL": "https://raw.githubusercontent.com/cornerstonejs/cornerstoneTools/master/docs/book.json",
"options": [
{
"options": [{
"value": "https://tools.cornerstonejs.org/history/v2/",
"text": "Version 2.x",
"selected": true
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
4 changes: 1 addition & 3 deletions docs/v3/book.json → docs/previous/v3/book.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"-fontsettings",
"github",
"ga",
"sitemap",
"versions"
],
"pluginsConfig": {
Expand All @@ -26,8 +25,7 @@
},
"versions": {
"gitbookConfigURL": "https://raw.githubusercontent.com/cornerstonejs/cornerstoneTools/master/docs/book.json",
"options": [
{
"options": [{
"value": "https://tools.cornerstonejs.org/history/v2/",
"text": "Version 2.x"
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/drawing/drawArrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import drawJoinedLines from './drawJoinedLines.js';
* @param {Object} end The end position.
* @param {string} color The color of the arrow.
* @param {number} lineWidth The width of the arrow line.
* @param {number[]|| undefined} [lineDash] The optional lineDash style.
* @param {number[] | undefined} [lineDash] The optional lineDash style.
* @returns {undefined}
*/
export default function(context, start, end, color, lineWidth, lineDash) {
Expand Down
2 changes: 1 addition & 1 deletion src/store/modules/segmentationModule/colorLUT.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function getColorForSegmentIndexColorLUT(
*
* @param {Object|number} labelmap3DOrColorLUTIndex Either a `Labelmap3D` object (who's referenced colorLUT will be changed), or a colorLUTIndex.
* @param {number} segmentIndex The segmentIndex color to change.
* @param {[number,number,number,number]} colorArray The color values in RGBA array format.
* @param {number[]} colorArray The color values in RGBA array format (required length 4).
*/
export function setColorForSegmentIndexOfColorLUT(
labelmap3DOrColorLUTIndex,
Expand Down
23 changes: 18 additions & 5 deletions src/tools/segmentation/strategies/correction.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const logger = getLogger('util:segmentation:operations:correction');
* - Stroke in-out-in: Section is added.
*
* @param {Object} evt The cornerstone event.
* @param {} operationData An object containing the `pixelData` to
* @param {Object} operationData An object containing the `pixelData` to
* modify, the `segmentIndex` and the `points` array.
*
* @returns {null}
Expand Down Expand Up @@ -462,13 +462,26 @@ function getNodesPerpendicularToPathPixel(pathPixel, nextPathPixel) {
}

/**
* Splits the path of nodes into seperate add/remove operations.
* @typedef {Object} Node
* @property {number} x - the X position
* @property {number} y - the Y position
* @property {number} segment - The segment index
*/

/**
* @typedef {Object} SegmentationOperations
* @property {boolean} additive - Whether the operation is additive or not
* @property {Node[]} nodes - The array of nodes
*/

/**
* Splits the path of nodes into separate add/remove operations.
*
* @param {Object[]} nodes The array of nodes.
* @param {number} segmentIndex The label value to replace.
* @returns {{additive: boolean, nodes: []}[]} An array of operations to perform,
* whether they are `additive` and the
* corresponding `nodes` of the operation.
* @returns {SegmentationOperations[]} An array of operations to perform,
* whether they are `additive` and the
* corresponding `nodes` of the operation.
*/
function splitLineIntoSeperateOperations(nodes, segmentIndex) {
// Check whether the first node is inside a segment of the appropriate label or not.
Expand Down

0 comments on commit 8d114b3

Please sign in to comment.