|
1 | 1 | package cbit.vcell.VirtualMicroscopy; |
2 | 2 |
|
3 | 3 | import cbit.image.ImageSizeInfo; |
| 4 | +import cbit.vcell.field.FieldDataFileConversion; |
4 | 5 | import loci.formats.*; |
5 | 6 | import loci.formats.gui.AWTImageTools; |
6 | 7 | import loci.formats.gui.BufferedImageReader; |
@@ -103,25 +104,7 @@ private ImageDataset[] readZipFile(String imageID,boolean bAll,boolean bMergeCha |
103 | 104 | continue; |
104 | 105 | } |
105 | 106 | String entryName = entry.getName(); |
106 | | - String imageFileSuffix = null; |
107 | | - int dotIndex = entryName.indexOf("."); |
108 | | - if(dotIndex != -1){ |
109 | | - imageFileSuffix = entryName.substring(dotIndex); |
110 | | - } |
111 | | - InputStream zipInputStream = zipFile.getInputStream(entry); |
112 | | - File tempImageFile = File.createTempFile("ImgDataSetReader", imageFileSuffix); |
113 | | - tempImageFile.deleteOnExit(); |
114 | | - FileOutputStream fos = new FileOutputStream(tempImageFile,false); |
115 | | - byte[] buffer = new byte[50000]; |
116 | | - while (true){ |
117 | | - int bytesRead = zipInputStream.read(buffer); |
118 | | - if (bytesRead==-1){ |
119 | | - break; |
120 | | - } |
121 | | - fos.write(buffer, 0, bytesRead); |
122 | | - } |
123 | | - fos.close(); |
124 | | - zipInputStream.close(); |
| 107 | + File tempImageFile = FieldDataFileConversion.getFileFromZipEntry(entry, zipFile); |
125 | 108 | ImageDataset[] imageDatasetChannels = null; |
126 | 109 | try { |
127 | 110 | imageDatasetChannels = readImageDatasetChannels(tempImageFile.getAbsolutePath(),bMergeChannels,null,resize); |
|
0 commit comments