feat(Calibration Tool): add a calibration tool that can manually recalibrate an image and measurements on it (#3136)

* minor bug fix - reading modalities

* react error log fix - button props

* react warn fix - Typography color prop

* calibration tool without persistence

* added toolbar button for calibration tool

* icon change for calibration tool

* important bug fix for calibration - length and calibration rate calculation

* fix weird autocorrection

* [fix] bugs after merging upstream

* [refactor] conform to the new service names
This commit is contained in:
md-prog authored and GitHub committed 2023-02-22 21:01:36 -05:00
1 parent 7a36363735
commit b15988359f
18 files changed
+288 -22

No files matched your search

@@ -9,23 +9,35 @@ import { Input, Dialog } from '@ohif/ui';
* @param {*} event
* @param {*} callback
* @param {*} isArrowAnnotateInputDialog
* @param {*} dialogConfig
* @param {string?} dialogConfig.dialogTitle - title of the input dialog
* @param {string?} dialogConfig.inputLabel - show label above the input
*/
function callInputDialog(
uiDialogService,
data,
callback,
isArrowAnnotateInputDialog = true
isArrowAnnotateInputDialog = true,
dialogConfig: any = {}
) {
const dialogId = 'enter-annotation';
const dialogId = 'dialog-enter-annotation';
const label = data
? isArrowAnnotateInputDialog
? data.text
: data.label
: '';
const {
dialogTitle = 'Enter your annotation',
inputLabel = '',
validateFunc = value => true,
} = dialogConfig;
const onSubmitHandler = ({ action, value }) => {
switch (action.id) {
case 'save':
if (typeof validateFunc === 'function' && !validateFunc(value.label))
return;
callback(value.label, action.id);
break;
case 'cancel':
@@ -43,7 +55,7 @@ function callInputDialog(
showOverlay: true,
content: Dialog,
contentProps: {
title: 'Enter your annotation',
title: dialogTitle,
value: { label },
noCloseButton: true,
onClose: () => uiDialogService.dismiss({ id: dialogId }),
@@ -61,6 +73,8 @@ function callInputDialog(
type="text"
id="annotation"
containerClassName="mr-2"
label={inputLabel}
labelClassName="text-primary-light"
value={value.label}
onChange={event => {
event.persist();