Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
36 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,6 +146,27 @@ function getVectorStringLPS(vector) { | |
return orientation; | ||
} | ||
|
||
/** | ||
Check warning on line 149 in src/math/orientation.js GitHub Actions / build
|
||
* Get the LPS 'group' (axial, coronal or sagittal) from a LPS code. | ||
* | ||
* @param {string} lps The LPS code string. | ||
Check failure on line 152 in src/math/orientation.js GitHub Actions / build
Check warning on line 152 in src/math/orientation.js GitHub Actions / build
|
||
* @returns {string} The group. | ||
*/ | ||
export function getLPSGroup(code) { | ||
let orientStr; | ||
const axialCodes = ['LPS', 'LAI', 'RPI', 'RAS']; | ||
const coronalCodes = ['LSA', 'LIP', 'RSP', 'RIA']; | ||
const sagittalCodes = ['PSL', 'PIR', 'ASR', 'AIL']; | ||
if (axialCodes.includes(code)) { | ||
orientStr = Orientation.Axial; | ||
} else if (coronalCodes.includes(code)) { | ||
orientStr = Orientation.Coronal; | ||
} else if (sagittalCodes.includes(code)) { | ||
orientStr = Orientation.Sagittal; | ||
} | ||
return orientStr; | ||
} | ||
|
||
/** | ||
* Get the orientation matrix associated to the direction cosines. | ||
* | ||
|
@@ -166,4 +187,4 @@ export function getOrientationFromCosines(cosines) { | |
]); | ||
} | ||
return orientationMatrix; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters