Skip to content

Commit

Permalink
Fixes issue when showing large tables
Browse files Browse the repository at this point in the history
  • Loading branch information
tischi committed Jul 5, 2024
1 parent 049fcad commit 59d0646
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<groupId>org.embl.mobie</groupId>
<artifactId>mobie-viewer-fiji</artifactId>
<version>5.1.3-SNAPSHOT</version>
<version>5.1.5-SNAPSHOT</version>

<!-- force javadoc generation to fetch errors: -->
<!-- mvn javadoc:javadoc | grep error -->
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/org/embl/mobie/lib/data/ImageGridSources.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ private void setMetadata( Integer channelIndex )
{
// Take the first source to fetch metadata
metadataSource = nameToFullPath.keySet().iterator().next();
long start = System.currentTimeMillis();
IJ.log( "Fetching metadata for channel " + channelIndex + "..." );
IJ.log( "...from " + nameToFullPath.get( metadataSource ) );
// FIXME: Cache the image data, because for multiple images it is now reloaded!
Expand All @@ -192,7 +193,7 @@ private void setMetadata( Integer channelIndex )
IJ.log( "Slices: " + metadata.numZSlices );
IJ.log( "Frames: " + metadata.numTimePoints );

// determine contrast limits if affordable
// determine contrast limits, if affordable
RandomAccessibleInterval< ? > lowResRAI = source.getSource( 0, source.getNumMipmapLevels() - 1 );
long numElements = Intervals.numElements( lowResRAI.dimensionsAsLongArray() );
if ( numElements < 1024 * 1024 )
Expand All @@ -202,11 +203,11 @@ private void setMetadata( Integer channelIndex )
}
else
{
IJ.log( "Image is too large => taking contrast limits from datatype..." );
IJ.log( "Image is large, thus taking contrast limits from datatype range." );
}

IJ.log( "Contrast limits: " + Arrays.toString( metadata.contrastLimits ) );

IJ.log( "Fetched metadata in " + ( System.currentTimeMillis() - start ) + " ms." );

}

Expand Down
4 changes: 1 addition & 3 deletions src/main/java/org/embl/mobie/lib/table/TableView.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public void close()

public void show()
{

// Prefetch the columns and wait a bit as this hopefully makes it less likely that
// there are errors thrown by Java Swing when rendering the table window
// below during frame.pack()
Expand Down Expand Up @@ -168,13 +167,12 @@ private void configureJTable()
{
swingTableModel = new SwingTableModel( tableModel );
jTable = new JTable( swingTableModel );
TableColumnModel columnModel = jTable.getColumnModel();
TableColumn column = columnModel.getColumn( 0 );
jTable.updateUI();
jTable.setPreferredScrollableViewportSize( new Dimension( 500, 200 ) );
jTable.setFillsViewportHeight( true );
jTable.setAutoCreateRowSorter( true );
jTable.setRowSelectionAllowed( true );
jTable.setAutoResizeMode( JTable.AUTO_RESIZE_OFF );
jTable.setSelectionMode( ListSelectionModel.SINGLE_SELECTION );
}

Expand Down

0 comments on commit 59d0646

Please sign in to comment.