viz_parser.add_argument("--source",default=False,help="Path to the image file")
viz_parser.add_argument(
"--destination",default="k3d.html",help="Path to save html file."
)
viz_parser.add_argument(
"--no-browser",action="store_true",help="Do not launch browser."
)
# Preview
# Preview
preview_parser=subparsers.add_parser('preview',help='Preview of the image in CLI')
preview_parser=subparsers.add_parser(
preview_parser.add_argument('filename',type=str,metavar='FILENAME',help='Path to image that will be displayed')
"preview",help="Preview of the image in CLI"
preview_parser.add_argument('--slice',type=int,metavar='S',default=None,help='Specifies which slice of the image will be displayed.\nDefaults to middle slice. If number exceeds number of slices, last slice will be displayed.')
)
preview_parser.add_argument('--axis',type=int,metavar='AX',default=0,help='Specifies from which axis will be the slice taken. Defaults to 0.')
preview_parser.add_argument(
preview_parser.add_argument('--resolution',type=int,metavar='RES',default=80,help='Resolution of displayed image. Defaults to 80.')
"filename",
preview_parser.add_argument('--absolute_values',action='store_false',help='By default set the maximum value to be 255 so the contrast is strong. This turns it off.')
type=str,
metavar="FILENAME",
help="Path to image that will be displayed",
)
preview_parser.add_argument(
"--slice",
type=int,
metavar="S",
default=None,
help="Specifies which slice of the image will be displayed.\nDefaults to middle slice. If number exceeds number of slices, last slice will be displayed.",
)
preview_parser.add_argument(
"--axis",
type=int,
metavar="AX",
default=0,
help="Specifies from which axis will be the slice taken. Defaults to 0.",
)
preview_parser.add_argument(
"--resolution",
type=int,
metavar="RES",
default=80,
help="Resolution of displayed image. Defaults to 80.",
)
preview_parser.add_argument(
"--absolute_values",
action="store_false",
help="By default set the maximum value to be 255 so the contrast is strong. This turns it off.",
)
args=parser.parse_args()
args=parser.parse_args()
ifargs.subcommand=='gui':
ifargs.subcommand=="gui":
arghost=args.host
arghost=args.host
inbrowser=notargs.no_browser# Should automatically open in browser
inbrowser=notargs.no_browser# Should automatically open in browser
ifargs.data_explorer:
ifargs.data_explorer:
ifargs.platform:
ifargs.platform:
data_explorer.run_interface(arghost)
data_explorer.run_interface(arghost)
...
@@ -53,42 +96,74 @@ def main():
...
@@ -53,42 +96,74 @@ def main():
else:
else:
interface=iso3d.Interface()
interface=iso3d.Interface()
interface.launch(inbrowser=inbrowser)
interface.launch(inbrowser=inbrowser)
elifargs.annotation_tool:
elifargs.annotation_tool:
ifargs.platform:
ifargs.platform:
annotation_tool.run_interface(arghost)
annotation_tool.run_interface(arghost)
else:
else:
interface=annotation_tool.Interface()
interface=annotation_tool.Interface()
interface.launch(inbrowser=inbrowser)
interface.launch(inbrowser=inbrowser)
elifargs.local_thickness:
elifargs.local_thickness:
ifargs.platform:
ifargs.platform:
local_thickness.run_interface(arghost)
local_thickness.run_interface(arghost)
else:
else:
interface=local_thickness.Interface()
interface=local_thickness.Interface()
interface.launch(inbrowser=inbrowser)
interface.launch(inbrowser=inbrowser)
elifargs.subcommand=="viz":
ifargs.subcommand=="viz":
ifnotargs.source:
ifnotargs.source:
print("Please specify a source file using the argument --source")
print("Please specify a source file using the argument --source")