xtk

Change the 'config' attribute of an interactor for disabling some user events

≡放荡痞女 提交于 2020-02-07 05:36:10
问题 I'd like to display several views of the same scene, with 1 of them full interactive, and 2 others from top and right and which could only be zoomed. So my issue is to disable some user interactions on a render. One alternative is to overload the other events handler methods with forcing the renderer's camera to keep the same view if the event isn't a mouse wheel. It works but it's not pretty (neither for a programmer nor a user). So I want to change the 'config' attribute of my renderer.

Wrong volume bounding box

蓝咒 提交于 2020-01-05 21:15:31
问题 I'm using Xtk to make a widget to measure distances in a volume. In the scene there are four object: a volume, two spheres an a cube. the cube is placed at origin and the spheres are translated 30 units along X and Y axis, each in opposite direction, as shown below: https://docs.google.com/file/d/0B2oRl7iWfVvTaXAyckNTOC04RlE/edit?usp=sharing The cube and the spheres are placed in the right position, but the problem arises when the volume is included in the scene, changing the coordinate

Wrong volume bounding box

情到浓时终转凉″ 提交于 2020-01-05 21:13:59
问题 I'm using Xtk to make a widget to measure distances in a volume. In the scene there are four object: a volume, two spheres an a cube. the cube is placed at origin and the spheres are translated 30 units along X and Y axis, each in opposite direction, as shown below: https://docs.google.com/file/d/0B2oRl7iWfVvTaXAyckNTOC04RlE/edit?usp=sharing The cube and the spheres are placed in the right position, but the problem arises when the volume is included in the scene, changing the coordinate

How to change a pixel value in XTK

我们两清 提交于 2019-12-25 04:12:14
问题 I would like to know how to change a pixel value for the label map. This is my initial approach. Unfortunately, the changes are not reflected in the canvas. X.volume.prototype.SetPixelLabelMap = function(i, j, k, value){ this._labelmap._IJKVolume[k][j][i] = value; var color = this._labelmap._colortable._map.get(value); var changeRawData = function(rawdata, pos){ for(var n = 0; n < 4; n++){ rawdata[pos + n] = color[n + 1]; } } var dim = this._dimensions; //in Z axis height is j width is i, the

Othographic Projection in XTK

北城以北 提交于 2019-12-20 06:18:35
问题 So I am using XTK to develop a app that will allow users to view multiple 3D meshes in one renderer. The problem is that it uses a perspective camera instead of a orthographic, which causes panning to 'rotate' the meshes a bit. Has anyone been successful in getting XTK to render orthographically without modifying source code? I would rather not modify it but if I have to I will. Thank you! 回答1: So from what I can see, there's no way to set a 3D camera to be in orthographic perspective without

Load volume in xtk without initializing a renderer

冷暖自知 提交于 2019-12-14 03:07:46
问题 I'm using xtk to read remote NIfTI volumes into an application. My sole objective is to obtain a volume object so I can extract its data; I don't need to render anything. The examples I've seen all initialize a renderer and attach a volume before accessing its contents. E.g. (from http://jsfiddle.net/QxMSt/5/): var r = new X.renderer3D(); r.init(); var v = new X.volume(); v.file = 'http://www.cogitatum.org/mprage003.nii.gz'; r.add(v); r.render(); r.onShowtime = function() { r.destroy(); //

xtk 2D renderer linking with onMousedown position

拟墨画扇 提交于 2019-12-12 01:27:18
问题 Is there a way to link three 2D renderers together so that when one is clicked on the other two move to the slices of the point that was clicked? Here is an example of what I mean. The current onMousedown behavior in a 2drenderer is to adjust window level, can this behavior be turned off, on or modified? 回答1: This is not possible right now. There was some work on unprojecting a 3D scene to get from screen coordinates to world coordinates. See https://github.com/xtk/X/issues/78 Unfortunately

xtk volume rendering with .vtk file created from matlab

99封情书 提交于 2019-12-12 00:34:48
问题 I am beginning with XTK. I would like to load a .vtk file in order to make volume rendering into XTK. This .vtk file has been created with a matlab function which saves a 3D data array (voxel) into vtk format : function savevtk(array, filename) % savevtk Save a 3-D scalar array in VTK format. % savevtk(array, filename) saves a 3-D array of any size to % filename in VTK format. [nx, ny, nz] = size(array); fid = fopen(filename, 'wt'); fprintf(fid, '# vtk DataFile Version 2.0\n'); fprintf(fid,

Is there a way to use a Custom cross-sectional slicer of 3d image data?

别来无恙 提交于 2019-12-11 19:47:00
问题 I mean, is there a way to use the current slicer to show a sectional slice (not aligned with the canonical Axis) of the 3D image data? or better, a sectional slice of a predefined size. If there is no exists, how can I contribute with this ?? Regards, P 回答1: currently this is not possible but you are very welcome to contribute. the parsers of NRRD and MGH/MGZ format store a 3D array of the image. All X.slices are configured using a front and an up vector.. now we only have to link the X.slice

Not able to visualize a loaded data

被刻印的时光 ゝ 提交于 2019-12-11 05:47:33
问题 I just start to test xtk, and no problem with the first sample of the cube. I now try to load an external data, but stored locally into my filesystem (just download skull sample of example 05) and put in the same directory of the html. I'm not able to see anything. I've also run the tests and the visualization is ok but when I try to open one of test htmls, it isn't able to visualize the sample. Is there some problem of path? I really try to put myself in the most simple situation but I don't