Operating system: win10 64-bit
Slicer version:4.9.0-2017-10-23 r26509
Expected behavior: the mask value of GetBinaryLabelmapRepresentation() is same with original mask
Actual behavior:mask value which got from Binary GetBinaryLabelmapRepresentation() is different with original inputted mask value.
Hi SlicerExperts:
I am trying to show a segment with the mask value from a json file,below is my steps:
1.create a vtkImageData,and set the basic values from below lines:
"mask": {
"zBegin": "19.104156494140625",
"xBegin": "67.1884765625",
"yEnd": "-103.6318359375",
"zEnd": "25.404266357421875",
"yBegin": "-99.7353515625",
"sliceMask": {
"count": "10",
"item": "000000000000000000010000000000000000000000000000",
"item": "000000000111100001111000011111000011100000000000",
"item": "011110000111110011111100111111000111110000110000",
"item": "011111001111111011111110111111100111110001111000",
"item": "011111001111111011111111111111101111111001111100",
"item": "011111001111111011111111111111111111111001111100",
"item": "011110001111110011111111111111110111111001111100",
"item": "001100000111110011111110111111100111110000111000",
"item": "000000000111100001111000011110000011100000000000",
"item": "000000000000000000000000000100000000000000000000",
}
2. create a vtkMarchingCubes and passed step1's result to setInputData () when creating a corresponding polydata;
3. create one modelNode ,SetAndObservePolyData(step1's polydata) and segmentationNode ,used ImportModelToSegmentationNode(modelNode, segmentationNode) to bind the modelNode to segmentationNode;
4.call rep = segmentationNode.GetBinaryLabelmapRepresentation(segmentID) to get the specific segment, and assigned arr = rep.GetPointData().GetArray(0) to get all of the points of this Segment,and output below mask values:
outputmask=['000000000000000000001000000000000000000000000000',
'000000000001111000011110001111100001110000000000',
'000111100011111000111111001111110011111000001100',
'001111100111111101111111011111110011111000011110',
'001111100111111111111111011111110111111100111110',
'001111100111111111111111111111110111111100111110',
'000111100011111111111111111111110111111000111110',
'000011000011111001111111011111110011111000011100',
'000000000001111000011110000111100001110000000000',
'000000000000000000000000000010000000000000000000']
The result can not match original mask values,it seems there are some data have been changed ,we want to get the mask value of segment is same with the original data,could you give us some ideas?
Thanks,
Chunbo