Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BigDataViewer_Server_Extension
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BioinformaticDataCompression
BigDataViewer_Server_Extension
Commits
a51599b1
Commit
a51599b1
authored
10 years ago
by
Tobias Pietzsch
Browse files
Options
Downloads
Patches
Plain Diff
add "-t" command line option to set thumbnail directory
parent
0a6c7a03
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/bdv/server/BigDataServer.java
+20
-6
20 additions, 6 deletions
src/main/java/bdv/server/BigDataServer.java
src/main/java/bdv/server/CellHandler.java
+1
-2
1 addition, 2 deletions
src/main/java/bdv/server/CellHandler.java
with
21 additions
and
8 deletions
src/main/java/bdv/server/BigDataServer.java
+
20
−
6
View file @
a51599b1
...
@@ -40,6 +40,8 @@ import java.util.Map.Entry;
...
@@ -40,6 +40,8 @@ import java.util.Map.Entry;
* per line. Each line is formatted as "NAME <TAB> XML".
* per line. Each line is formatted as "NAME <TAB> XML".
* -p <PORT> Listening port. (default: 8080)
* -p <PORT> Listening port. (default: 8080)
* -s <HOSTNAME> Hostname of the server.
* -s <HOSTNAME> Hostname of the server.
* -t <DIRECTORY> Directory to store thumbnails. (new temporary directory
* by default.)
* -m enable statistics and manager context. EXPERIMENTAL!
* -m enable statistics and manager context. EXPERIMENTAL!
* </pre>
* </pre>
*
*
...
@@ -65,8 +67,9 @@ public class BigDataServer
...
@@ -65,8 +67,9 @@ public class BigDataServer
{
{
hostname
=
"localhost"
;
hostname
=
"localhost"
;
}
}
final
String
thumbnailDirectory
=
null
;
final
boolean
enableManagerContext
=
false
;
final
boolean
enableManagerContext
=
false
;
return
new
Parameters
(
port
,
hostname
,
new
HashMap
<
String
,
String
>(),
enableManagerContext
);
return
new
Parameters
(
port
,
hostname
,
new
HashMap
<
String
,
String
>(),
thumbnailDirectory
,
enableManagerContext
);
}
}
public
static
void
main
(
final
String
[]
args
)
throws
Exception
public
static
void
main
(
final
String
[]
args
)
throws
Exception
...
@@ -133,13 +136,16 @@ public class BigDataServer
...
@@ -133,13 +136,16 @@ public class BigDataServer
*/
*/
private
final
Map
<
String
,
String
>
datasetNameToXml
;
private
final
Map
<
String
,
String
>
datasetNameToXml
;
private
final
String
thumbnailDirectory
;
private
final
boolean
enableManagerContext
;
private
final
boolean
enableManagerContext
;
Parameters
(
final
int
port
,
final
String
hostname
,
final
Map
<
String
,
String
>
datasetNameToXml
,
final
boolean
enableManagerContext
)
Parameters
(
final
int
port
,
final
String
hostname
,
final
Map
<
String
,
String
>
datasetNameToXml
,
final
String
thumbnailDirectory
,
final
boolean
enableManagerContext
)
{
{
this
.
port
=
port
;
this
.
port
=
port
;
this
.
hostname
=
hostname
;
this
.
hostname
=
hostname
;
this
.
datasetNameToXml
=
datasetNameToXml
;
this
.
datasetNameToXml
=
datasetNameToXml
;
this
.
thumbnailDirectory
=
thumbnailDirectory
;
this
.
enableManagerContext
=
enableManagerContext
;
this
.
enableManagerContext
=
enableManagerContext
;
}
}
...
@@ -155,7 +161,7 @@ public class BigDataServer
...
@@ -155,7 +161,7 @@ public class BigDataServer
public
String
getThumbnailDirectory
()
public
String
getThumbnailDirectory
()
{
{
return
null
;
return
thumbnailDirectory
;
}
}
/**
/**
...
@@ -205,6 +211,12 @@ public class BigDataServer
...
@@ -205,6 +211,12 @@ public class BigDataServer
.
withArgName
(
"FILE"
)
.
withArgName
(
"FILE"
)
.
create
(
"d"
)
);
.
create
(
"d"
)
);
options
.
addOption
(
OptionBuilder
.
withDescription
(
"Directory to store thumbnails. (new temporary directory by default.)"
)
.
hasArg
()
.
withArgName
(
"DIRECTORY"
)
.
create
(
"t"
)
);
if
(
Constants
.
ENABLE_EXPERIMENTAL_FEATURES
)
if
(
Constants
.
ENABLE_EXPERIMENTAL_FEATURES
)
{
{
options
.
addOption
(
OptionBuilder
options
.
addOption
(
OptionBuilder
...
@@ -222,8 +234,10 @@ public class BigDataServer
...
@@ -222,8 +234,10 @@ public class BigDataServer
final
int
port
=
Integer
.
parseInt
(
portString
);
final
int
port
=
Integer
.
parseInt
(
portString
);
// Getting server name option
// Getting server name option
final
String
serverString
=
cmd
.
getOptionValue
(
"s"
,
defaultParameters
.
getHostname
()
);
final
String
serverName
=
cmd
.
getOptionValue
(
"s"
,
defaultParameters
.
getHostname
()
);
final
String
serverName
=
serverString
;
// Getting thumbnail directory option
final
String
thumbnailDirectory
=
cmd
.
getOptionValue
(
"t"
,
defaultParameters
.
getThumbnailDirectory
()
);
final
HashMap
<
String
,
String
>
datasets
=
new
HashMap
<
String
,
String
>(
defaultParameters
.
getDatasets
()
);
final
HashMap
<
String
,
String
>
datasets
=
new
HashMap
<
String
,
String
>(
defaultParameters
.
getDatasets
()
);
...
@@ -280,7 +294,7 @@ public class BigDataServer
...
@@ -280,7 +294,7 @@ public class BigDataServer
if
(
datasets
.
isEmpty
()
)
if
(
datasets
.
isEmpty
()
)
throw
new
IllegalArgumentException
(
"Dataset list is empty."
);
throw
new
IllegalArgumentException
(
"Dataset list is empty."
);
return
new
Parameters
(
port
,
serverName
,
datasets
,
enableManagerContext
);
return
new
Parameters
(
port
,
serverName
,
datasets
,
thumbnailDirectory
,
enableManagerContext
);
}
}
catch
(
final
ParseException
|
IllegalArgumentException
e
)
catch
(
final
ParseException
|
IllegalArgumentException
e
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/main/java/bdv/server/CellHandler.java
+
1
−
2
View file @
a51599b1
...
@@ -277,8 +277,7 @@ public class CellHandler extends ContextHandler
...
@@ -277,8 +277,7 @@ public class CellHandler extends ContextHandler
{
{
final
String
thumbnailFileName
=
thumbnailsDirectory
+
"/"
+
datasetName
+
".png"
;
final
String
thumbnailFileName
=
thumbnailsDirectory
+
"/"
+
datasetName
+
".png"
;
final
File
thumbnailFile
=
new
File
(
thumbnailFileName
);
final
File
thumbnailFile
=
new
File
(
thumbnailFileName
);
if
(
!
thumbnailFile
.
isFile
()
)
// do not recreate thumbnail if it
if
(
!
thumbnailFile
.
isFile
()
)
// do not recreate thumbnail if it already exists
// already exists
{
{
final
BufferedImage
bi
=
ThumbnailGenerator
.
makeThumbnail
(
spimData
,
baseFilename
,
Constants
.
THUMBNAIL_WIDTH
,
Constants
.
THUMBNAIL_HEIGHT
);
final
BufferedImage
bi
=
ThumbnailGenerator
.
makeThumbnail
(
spimData
,
baseFilename
,
Constants
.
THUMBNAIL_WIDTH
,
Constants
.
THUMBNAIL_HEIGHT
);
try
try
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment