mirror of
https://github.com/paulscherrerinstitute/ch.psi.imagej.hdf5.git
synced 2025-04-19 20:50:02 +02:00
Hacked grouping of (2D) datasets into the code as a proof of principle
...
This commit is contained in:
parent
966884310b
commit
2250170f04
@ -69,6 +69,29 @@ public class HDF5Reader implements PlugIn {
|
||||
List<Dataset> datasets = HDF5Utilities.getDatasets(file);
|
||||
SelectedDatasets selectedDatasets = selectDatasets(datasets);
|
||||
|
||||
|
||||
// TODO Remove
|
||||
// Hack as a proof of principle
|
||||
if(selectedDatasets.isGroup()){
|
||||
ImageStack stack = null;
|
||||
|
||||
for (Dataset var : selectedDatasets.getDatasets()) {
|
||||
if(stack == null){
|
||||
long[] dimensions= var.getDims();
|
||||
stack = new ImageStack((int) dimensions[1], (int) dimensions[0]);
|
||||
}
|
||||
|
||||
Object wholeDataset = var.read();
|
||||
addSlice(stack, wholeDataset);
|
||||
}
|
||||
|
||||
ImagePlus imp = new ImagePlus(filename, stack);
|
||||
imp.resetDisplayRange();
|
||||
imp.show();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
for (Dataset var : selectedDatasets.getDatasets()) {
|
||||
|
||||
// Read dataset attributes and properties
|
||||
@ -286,7 +309,7 @@ public class HDF5Reader implements PlugIn {
|
||||
JPanel panel = new JPanel();
|
||||
panel.setLayout(new BoxLayout(panel,BoxLayout.Y_AXIS));
|
||||
panel.add(scroll);
|
||||
JCheckBox checkbox = new JCheckBox("Group Datasets");
|
||||
JCheckBox checkbox = new JCheckBox("Group Datasets (2D datasets only)");
|
||||
panel.add(checkbox);
|
||||
|
||||
gd = new GenericDialog("Variable Name Selection");
|
||||
|
Loading…
x
Reference in New Issue
Block a user