Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BigDataViewer_Fiji_Plugin
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_Fiji_Plugin
Commits
08f9d916
Commit
08f9d916
authored
10 years ago
by
Tobias Pietzsch
Browse files
Options
Downloads
Patches
Plain Diff
add "BDV > Open Imaris (experimental)" plugin
parent
b57d609a
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/ij/OpenImarisPlugIn.java
+125
-0
125 additions, 0 deletions
src/main/java/bdv/ij/OpenImarisPlugIn.java
src/main/resources/plugins.config
+1
-0
1 addition, 0 deletions
src/main/resources/plugins.config
with
126 additions
and
0 deletions
src/main/java/bdv/ij/OpenImarisPlugIn.java
0 → 100644
+
125
−
0
View file @
08f9d916
package
bdv.ij
;
import
ij.ImageJ
;
import
ij.Prefs
;
import
ij.plugin.PlugIn
;
import
java.awt.FileDialog
;
import
java.awt.Frame
;
import
java.io.File
;
import
java.io.FilenameFilter
;
import
java.io.IOException
;
import
java.util.concurrent.atomic.AtomicBoolean
;
import
javax.swing.JFileChooser
;
import
javax.swing.filechooser.FileFilter
;
import
bdv.BigDataViewer
;
import
bdv.ij.util.ProgressWriterIJ
;
import
bdv.img.imaris.Imaris
;
import
bdv.spimdata.SpimDataMinimal
;
public
class
OpenImarisPlugIn
implements
PlugIn
{
static
String
lastDatasetPath
=
""
;
public
static
void
main
(
final
String
[]
args
)
{
ImageJ
.
main
(
args
);
new
OpenImarisPlugIn
().
run
(
null
);
}
@Override
public
void
run
(
final
String
arg
)
{
File
file
=
null
;
if
(
Prefs
.
useJFileChooser
)
{
final
JFileChooser
fileChooser
=
new
JFileChooser
();
fileChooser
.
setSelectedFile
(
new
File
(
lastDatasetPath
)
);
fileChooser
.
setFileFilter
(
new
FileFilter
()
{
@Override
public
String
getDescription
()
{
return
"ims files"
;
}
@Override
public
boolean
accept
(
final
File
f
)
{
if
(
f
.
isDirectory
()
)
return
true
;
if
(
f
.
isFile
()
)
{
final
String
s
=
f
.
getName
();
final
int
i
=
s
.
lastIndexOf
(
'.'
);
if
(
i
>
0
&&
i
<
s
.
length
()
-
1
)
{
final
String
ext
=
s
.
substring
(
i
+
1
).
toLowerCase
();
return
ext
.
equals
(
"ims"
);
}
}
return
false
;
}
}
);
final
int
returnVal
=
fileChooser
.
showOpenDialog
(
null
);
if
(
returnVal
==
JFileChooser
.
APPROVE_OPTION
)
file
=
fileChooser
.
getSelectedFile
();
}
else
// use FileDialog
{
final
FileDialog
fd
=
new
FileDialog
(
(
Frame
)
null
,
"Open"
,
FileDialog
.
LOAD
);
fd
.
setDirectory
(
new
File
(
lastDatasetPath
).
getParent
()
);
fd
.
setFile
(
new
File
(
lastDatasetPath
).
getName
()
);
final
AtomicBoolean
workedWithFilenameFilter
=
new
AtomicBoolean
(
false
);
fd
.
setFilenameFilter
(
new
FilenameFilter
()
{
private
boolean
firstTime
=
true
;
@Override
public
boolean
accept
(
final
File
dir
,
final
String
name
)
{
if
(
firstTime
)
{
workedWithFilenameFilter
.
set
(
true
);
firstTime
=
false
;
}
final
int
i
=
name
.
lastIndexOf
(
'.'
);
if
(
i
>
0
&&
i
<
name
.
length
()
-
1
)
{
final
String
ext
=
name
.
substring
(
i
+
1
).
toLowerCase
();
return
ext
.
equals
(
"ims"
);
}
return
false
;
}
}
);
fd
.
setVisible
(
true
);
if
(
!
workedWithFilenameFilter
.
get
()
)
{
fd
.
setFilenameFilter
(
null
);
fd
.
setVisible
(
true
);
}
final
String
filename
=
fd
.
getFile
();
if
(
filename
!=
null
)
{
file
=
new
File
(
fd
.
getDirectory
()
+
filename
);
}
}
if
(
file
!=
null
)
{
try
{
lastDatasetPath
=
file
.
getAbsolutePath
();
final
SpimDataMinimal
spimData
=
Imaris
.
openIms
(
file
.
getAbsolutePath
()
);
new
BigDataViewer
(
spimData
,
file
.
getName
(),
new
ProgressWriterIJ
()
);
}
catch
(
final
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
}
This diff is collapsed.
Click to expand it.
src/main/resources/plugins.config
+
1
−
0
View file @
08f9d916
...
...
@@ -16,4 +16,5 @@ Plugins>BigDataViewer, "Export Current Image as XML/HDF5", bdv.ij.ExportImagePlu
Plugins
>
BigDataViewer
,
"Export Spim Sequence as XML/HDF5"
,
bdv
.
ij
.
ExportSpimSequencePlugIn
Plugins
>
BigDataViewer
,
"Export Fused Sequence as XML/HDF5"
,
bdv
.
ij
.
ExportSpimFusionPlugIn
Plugins
>
BigDataViewer
,
"Export CellVoyager dataset as XML/HDF5"
,
bdv
.
ij
.
ExportCellVoyagerPlugIn
Plugins
>
BigDataViewer
,
"Open Imaris (experimental)"
,
bdv
.
ij
.
OpenImarisPlugIn
File
>
Import
,
"BigDataViewer..."
,
bdv
.
ij
.
ImportPlugIn
\ No newline at end of file
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