-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cli): Improve cli output and doc
- Loading branch information
Showing
12 changed files
with
180 additions
and
21 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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
title: Command Line Interface | ||
--- | ||
|
||
ITK/VTK Image Viewer can be used as a command line tool for opening and visualizing your local data file. | ||
|
||
## Installation | ||
|
||
First of all, you will need to install the tool on you system which will require Node.js. | ||
Assumming your environment already has node, you should be able to run the following command line. | ||
|
||
```sh | ||
$ npm install itk-vtk-image-viewer -g | ||
``` | ||
|
||
The command line will install globally the application which should enable a new command line: | ||
|
||
```sh | ||
$ ItkVtkImageViewer | ||
|
||
Usage: ItkVtkImageViewer [options] | ||
|
||
Options: | ||
|
||
-h, --help output usage information | ||
-V, --version output the version number | ||
-p, --port [3000] Start web server with given port | ||
-d, --data [directory] Data directory to serve | ||
-s, --server-only Do not open the web browser | ||
|
||
-f, --filter [nrrd,png,tiff,bmp] List files with those extensions in data directory | ||
``` | ||
|
||
## Usage | ||
|
||
Listed above are the various options available, but below are commonly used commands: | ||
|
||
|
||
### Quick start | ||
|
||
Start a server on default port without automatically opening a browser and sharing your local `~/itk-data` directory as `/data`. | ||
|
||
This allow to visualize file on the local file system via a given URL: | ||
- `http://10.21.3.245:3000/?fileToLoad=/data/005_20months_T2_Reg2Atlas.nrrd` | ||
|
||
```sh | ||
$ ItkVtkImageViewer -sd ~/itk-data | ||
|
||
ItkVtkImageViewer | ||
=> Serve /home/ItkConsortium/itk-data on port 3000 | ||
|
||
en0 => http://10.21.3.245:3000/ | ||
|
||
=> Available data files: | ||
|
||
/?fileToLoad=/data/005_20months_T2_Reg2Atlas.nrrd | ||
/?fileToLoad=/data/005_32months_Reg2Atlas_ManualBrainMask.nrrd | ||
/?fileToLoad=/data/ScreenShot2017.png | ||
``` | ||
|
||
### Drag and drop viewer | ||
|
||
```sh | ||
$ ItkVtkImageViewer -p | ||
``` | ||
|
||
![ItkVtkImageViewer](./viewer.jpg) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
title: Embedded Viewer | ||
--- | ||
|
||
ITK/VTK Image Viewer can be used within an existing web site as a library to embed interactive 3D visualization using remote datasets. | ||
To do so a container elements should be created for that view inside your current HTML content like follow. | ||
|
||
```html | ||
<div class="itk-vtk-image-viewer" /> | ||
``` | ||
|
||
Moreover, the JavaScript library should also be added to the web page. Only one of the following is required | ||
|
||
```html | ||
<script type="text/javascript" src="https://kitware.github.io/itk-vtk-image-viewer/app/itkVtkImageViewer.js"> | ||
``` | ||
or | ||
```html | ||
<script type="text/javascript" src="https://unpkg.com/itk-vtk-image-viewer/dist/itkVtkImageViewer.js"> | ||
``` | ||
### Viewer configuration | ||
The container `<div/>` can be extended with the following set of attributes: | ||
- (Mandatory) data-url="/data/005_36months_T2_RegT1_Reg2Atlas_ManualBrainMask_Stripped.nrrd" | ||
- (Optinal) data-viewport="300x200" | default is 500x500 | ||
- (Optinal) data-background-color="00aa00" | default is black | ||
![ItkVtkImageViewer-embedded](./embeddedViewer.jpg) | ||
```html | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
</head> | ||
<body> | ||
[...] | ||
<div | ||
style="float: right; display: inline-block; border: 2px solid gray; margin: 20px;" | ||
class="itk-vtk-image-viewer" | ||
data-url="/data/005_36months_T2_RegT1_Reg2Atlas_ManualBrainMask_Stripped.nrrd" | ||
data-viewport="300x200" | ||
></div> | ||
[...] | ||
<div | ||
style="float: left; display: inline-block; border: 2px solid gray; margin: 20px;" | ||
class="itk-vtk-image-viewer" | ||
data-url="/data/005_20months_T2_Reg2Atlas.nrrd" | ||
data-viewport="400x400" | ||
data-background-color="ffffff" | ||
></div> | ||
[...] | ||
<script type="text/javascript" src="itkVtkImageViewer.js"> | ||
</script> | ||
</body> | ||
</html> | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
title: Default viewer | ||
--- | ||
|
||
The default view of the ITK/VTK Image Viewer let you drag and drop into the page the data file that you want to look at. | ||
But an additional usage of that page is possible by providing extra arguments to the URL. This allow to reference remote dataset and enable there visualization in full screen. | ||
|
||
The extra argument to provide is `?fileToLoad=[...]` where the path provided can be relative to the current location on the Web or you can provide a full http:// url to the actual data. | ||
|
||
![ItkVtkImageViewer](./dataViewer.jpg) |
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
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
docs: | ||
getting_started: | ||
overview: index.html | ||
cli: cli.html | ||
viewer: viewer.html | ||
embeddedViewer: embeddedViewer.html |
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