-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from virtualcell/view-simulation-results-helpe…
…r-menu View simulation results helper menu
- Loading branch information
Showing
4 changed files
with
105 additions
and
2 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
57 changes: 57 additions & 0 deletions
57
view-simulation-results/src/main/java/org/vcell/N5/UI/HelpExplanation.java
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,57 @@ | ||
package org.vcell.N5.UI; | ||
|
||
import org.commonmark.node.Node; | ||
import org.commonmark.parser.Parser; | ||
import org.commonmark.renderer.html.HtmlRenderer; | ||
|
||
import javax.swing.*; | ||
import java.awt.*; | ||
import java.io.FileReader; | ||
import java.io.IOException; | ||
import java.net.URL; | ||
import java.nio.file.Files; | ||
import java.nio.file.Paths; | ||
|
||
public class HelpExplanation { | ||
private JDialog jDialog; | ||
|
||
public HelpExplanation(){ | ||
int height = 400; | ||
int width = 700; | ||
|
||
JPanel helperPanel = new JPanel(); | ||
JTextPane textPane = new JTextPane(); | ||
|
||
Parser parser = Parser.builder().build(); | ||
String md; | ||
URL mdPath = ClassLoader.getSystemClassLoader().getResource("Help.md"); | ||
try { | ||
md = new String(Files.readAllBytes(Paths.get(mdPath.getPath()))); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
Node node = parser.parse(md); | ||
HtmlRenderer renderer = HtmlRenderer.builder().build(); | ||
String text = renderer.render(node); | ||
textPane.setContentType("text/html"); | ||
textPane.setSize(width, height); | ||
textPane.setPreferredSize(new Dimension(width, height)); | ||
textPane.setText(text); | ||
textPane.setEditable(false); | ||
|
||
JScrollPane scrollPane = new JScrollPane(textPane); | ||
scrollPane.setSize(width, height); | ||
helperPanel.setSize(width, height); | ||
helperPanel.add(scrollPane); | ||
|
||
|
||
JOptionPane pane = new JOptionPane(helperPanel, JOptionPane.PLAIN_MESSAGE, 0, null, new Object[]{"Close"}); | ||
jDialog = pane.createDialog("Helper Menu"); | ||
jDialog.setModal(false); | ||
jDialog.setPreferredSize(new Dimension(width, height)); | ||
} | ||
|
||
public void displayHelpMenu(){ | ||
jDialog.setVisible(true); | ||
} | ||
} |
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,30 @@ | ||
### Intro | ||
The VCell (https://vcell.org/) application can export spatial simulation results into multiple formats, with | ||
.N5 (https://imagej.net/libs/n5) being one of them. N5 exports are | ||
stored remotely on VCell servers, allowing applications such as ImageJ | ||
to directly access the results of these simulations and perform analyses. | ||
|
||
### VCell Spatial Simulation | ||
Simulation solvers generating 2- or 3-dimensional spatial | ||
domains can be visualized in ImageJ using this plugin. | ||
Spatial dimensions and time directly correspond to fields within an ImageJ | ||
image. The image's channels depict different variables within a simulation. | ||
|
||
### N5 and Datasets | ||
Each N5 store is a direct mapping to a VCell simulation, and contains one or more | ||
datasets. Each dataset holds numerical data and metadata corresponding to an Image in ImageJ. | ||
Each N5 store is fully identified through its N5 URL which can be shared and opened by other applications | ||
which support the N5 format. | ||
|
||
|
||
### Accessing Simulation Results | ||
|
||
For VCell exports generated from your local VCell installation: | ||
- Either, Click the recent export button. | ||
|
||
- Or, Open the export table and view all past exports with their affiliated metadata. | ||
|
||
From N5 URL (VCell Install Not Required): | ||
- Click the 'Remote Files' button, paste the N5 URL, | ||
then select dataset from list. | ||
|