Skip to content

Commit

Permalink
use raw float arrays as protocol for isosurfaces, #3313
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrohnhofen committed Nov 13, 2018
1 parent 87878ce commit 079c08e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.scalableminds.webknossos.datastore.controllers

import java.io.{ByteArrayOutputStream, OutputStream}
import java.nio.{Buffer, ByteBuffer, ByteOrder, FloatBuffer}
import java.nio.file.Paths
import java.util.Base64

Expand Down Expand Up @@ -321,7 +322,9 @@ class BinaryDataController @Inject()(
isosurfaceRequest = IsosurfaceRequest(dataSource, segmentationLayer, request.body.cuboid(dataLayer), request.body.segmentId, request.body.mapping)
vertices <- isosurfaceService.requestIsosurface(isosurfaceRequest)
} yield {
Ok(Json.obj("vertices" -> vertices))
val responseBuffer = ByteBuffer.allocate(vertices.length * 4).order(ByteOrder.LITTLE_ENDIAN)
responseBuffer.asFloatBuffer().put(vertices)
Ok(responseBuffer.array())
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package com.scalableminds.webknossos.datastore.services.mcubes

import java.nio.IntBuffer

import com.scalableminds.util.geometry.{BoundingBox, Point3D}

import scala.collection.mutable
Expand Down

0 comments on commit 079c08e

Please sign in to comment.