Journal of Imaging

Article Marching Cubes and Histogram Pyramids for 3D Medical Visualization

Porawat Visutsak Department of Computer and Information Science, Faculty of Applied Science, King Mongkut’s University of Technology North Bangkok, Bangkok 10800, Thailand; [email protected]; Tel.: +66-2555-2000 (ext. 4225)

 Received: 1 July 2020; Accepted: 31 August 2020; Published: 3 September 2020 

Abstract: This paper aims to implement histogram pyramids with marching cubes method for 3D medical volumetric rendering. The histogram pyramids are used for feature extraction by segmenting the image into the hierarchical order like the pyramid shape. The histogram pyramids can decrease the number of sparse matrixes that will occur during manipulation. The important feature of the histogram pyramids is the direction of segments in the image. Then this feature will be used for connecting pixels (2D) to form up voxel (3D) during marching cubes implementation. The proposed method is fast and easy to implement and it also produces a smooth result (compared to the traditional marching cubes technique). The experimental results show the time consuming for generating 3D model can be reduced by 15.59% in average. The paper also shows the comparison between the surface rendering using the traditional marching cubes and the marching cubes with histogram pyramids. Therefore, for the volumetric rendering such as 3D medical models and terrains where a large number of lookups in 3D grids are performed, this method is a particularly good choice for generating the smooth surface of 3D object.

Keywords: marching cubes; histogram pyramids; volumetric rendering; 3D medical model; smooth voxel;

1. Introduction 3D visualization methods of human bone and organs were applied to diagnosis as long as 100 years ago [1]. Normally, 3D system aims to provide both quantitative and qualitative information for diagnosis. 3D visualization system can be divided into 4 operations: (1) preprocessing that deals with the volume of interest and features extraction; (2) visualization processes generate 3D object from 2D images; (3) manipulation explains the geometry of object that can be distorted and deformed; (4) analysis that deals with methods of quantify 3D object [2]. For medical volumetric rendering where 2D binary images (CT-volume) are feed to construct 3D object, collision detection algorithm is used to manipulate the intersecting fragments and generate triangulated mesh models (see Figure1a). The doctor can take this advantage of training by observing the demonstration of context of 3D manipulation of bone fragments and the resulting CT images [3]. More works of 3D visualization such as texture mapping and semi-automatic . Texture mapping technique constructs 3D object by interpreting the spatial relationships of 2D binary images and generates 3D visualization of perspective-mapped from each image layer [4]. Whereas, semi-automatic image segmentation allows the doctor to make the segmentation of subject by the area of interest [5]. Therefore, the major drawback of these methods is the computational cost of real time resampling for making texture in 3D object reconstruction process [4], and infeasibility for each individual segmentation [5] (see Figure1b,c). The alternative choice for 3D volumetric rendering is marching cubes. The marching cubes method keeps the coordinates conveyed by traversing the outline of 2D binary shape and marches them to construct 3D object [6–10]. The algorithm is based

J. Imaging 2020, 6, 88; doi:10.3390/jimaging6090088 www.mdpi.com/journal/jimaging J. Imaging 2020, 6, 88x FOR PEER REVIEW 2 of 12 J. Imaging 2020, 6, x FOR PEER REVIEW 2 of 12 on the configuration of 15 fundamental cubes (see Section 2). Figure 2 shows 3D human head model on the configurationconfiguration ofof 1515 fundamentalfundamental cubescubes (see(see SectionSection2 2).). FigureFigure2 2shows shows 3D 3D human human head head model model constructed by marching cubes method; the method used 150 slides of 2D image as input source. constructedconstructed byby marchingmarching cubescubes method;method; thethe methodmethod usedused 150150 slidesslides ofof 2D2D imageimage asas inputinput source.source.

(a) (b) (a) (b)

(c) (c) Figure 1. (a) Bone fracture displays in 3D visualization software, the Sobel-filter is used for detecting Figure 1.1. (a) Bone fracture displays in 3D visualization software,software, thethe Sobel-filterSobel-filter isis usedused forfor detectingdetecting the outline of bone [11]; (b) CT image slides and (c) 3D visualization [4]. thethe outlineoutline ofof bonebone [[11];11]; ((bb)) CTCT imageimage slidesslides andand ((cc)) 3D3D visualizationvisualization [[4].4].

Figure 2. 3D human head model, constructed by marching cubes method (the original source file file of Figure 2. 3D human head model, constructed by marching cubes method (the original source file of this figure figure is [[12]).12]). this figure is [12]). It seems like the marching cubes can reduce the computational time used for resampling in 3D It seems like the marching cubes can reduce the computational time used for resampling in ,It seems like but the the marching problem cubes still remains can reduce in observing the computational the qualitative time used information for resampling of 3D surface in 3D reconstruction, but the problem still remains in observing the qualitative information of 3D surface constructedreconstruction, using but marching the problem cubes. still One remains major in problem observing of marching the qualitative cubes is information the unused of 3D surface which constructed using marching cubes. One major problem of marching cubes is the unused voxels which canconstructed be generated using during marching parsing cubes. the One coordinates major problem and the of intensity marching values cubes of is 2Dthe images,unused thesevoxels unused which can be generated during parsing the coordinates and the intensity values of 2D images, these unused voxelscan be ageneratedffect for the during smoothness parsing of the 3D coordinates surface (the an detaild the ofintensity the surface values smoothness of 2D images, will these be explained unused voxels affect for the smoothness of 3D surface (the detail of the surface smoothness will be explained invoxels Sections affect4 andfor the6). smoothness To overcome of this 3D surface drawback, (the this detail paper of the introduces surface smoothness histogram will pyramids be explained with in Sections 4 and 6). To overcome this drawback, this paper introduces histogram pyramids with marchingin Sections cubes 4 and method 6). To forovercome 3D medical this volumetricdrawback, rendering.this paper Theintroduces histogram histogram pyramids pyramids organize with the marching cubes method for 3D medical volumetric rendering. The histogram pyramids organize the imagemarching entries cubes to formmethod the for voxel 3D related medical to volumetric the index values, rendering. the traversal The histogram of histogram pyramids pyramids organize is used the image entries to form the voxel related to the index values, the traversal of histogram pyramids is toimage construct entries the to point form listthe that voxel will related be later to usedthe index for generating values, the the traversal voxel. Theof histogram organization pyramids of paper is used to construct the point list that will be later used for generating the voxel. The organization of consistsused to ofconstruct (1) Introduction, the point (2)list The that brief will conceptbe later of used marching for generating cubes method, the voxel. (3) Reading The organization the intensity of paper consists of (1) Introduction, (2) The brief concept of marching cubes method, (3) Reading the paper consists of (1) Introduction, (2) The brief concept of marching cubes method, (3) Reading the

J. Imaging 2020, 6, 88 3 of 12 J. Imaging 2020, 6, x FOR PEER REVIEW 3 of 12 valueintensity of CT value images of CT for 3Dimages rendering, for 3D (4) rendering, Histogram (4) pyramids, Histogram (5) Implementation,pyramids, (5) Implementation, (6) Results, and (6) (7) ConclusionResults, and and (7) Conclusion future works. and future works.

2. Marching Cubes Original marching cubes cubes algorithm algorithm was was developed developed by by [6], [6 ],later later works works applied applied this this algorithm algorithm for for3D rendering 3D rendering using using 2D medical 2D medical images images(CT: Comp (CT:uted Computed Tomography Scan, MRI: Scan, Magnetic MRI: Resonance Magnetic ResonanceImaging, and Imaging, SPECT: and Single-Photon SPECT: Single-Photon Emission Computed Emission ComputedTomography) Tomography) sequence as sequence an input. as The an input.marching The cubes marching algorithm cubes will algorithm be explained will be later explained in this later section. in this More section. works More of volume works ofrendering volume renderingtechniques techniques such as [7] such used as [sampled7] used sampled scalar functi scalarons functions for displaying for displaying 3D surfaces, 3D surfaces, [8] presented [8] presented the theextended extended version version of ofvolume rendering that that used toto handle handle images images with with mixtures mixtures properties properties (color (color and texture).and texture). To deal To withdeal thewith boundary the boundary value value problems problems which which are the are main the task main for task detecting for detecting the outline the ofoutline 2D binary of 2D shape, binary [ 9shape,] applied [9] applied the shortest the shortest path analysis path analysis to the speed to the function speed function and used and it to used solve it anto unknownsolve an inunknown the surface in function.the surface [10 ]function. used the endoscope[10] used imagesthe endoscope for 3D surface images reconstruction; for 3D surface the sophisticatedreconstruction; equipment the sophisticated was used asequipment the fine-tuned was measurementused as the fine-tuned of object together measurement with 3D of grid object that wouldtogether be with fit for 3D the grid specific that would endoscope be fit image. for the specific endoscope image. As mentioned earlier, marchingmarching cubescubes algorithmalgorithm isis based on the configurationconfiguration of 15 fundamental cubes [[6].6]. 2D medical images (slides) contained the scalar value of gray scale will be used to construct thethe cubescubes basedbased onon theirtheir indexesindexes correspondcorrespond toto thethe configurationconfiguration of 1515 fundamentalfundamental cubes as shown inin FigureFigure3 3.. BasedBased onon [[13,14],13,14], a cube consists of eight vertices that can contain two values of 0 and 1; note thatthat thethe valuevalue of of 0 0 implies implies that that there there is is no no information information conveyed conveyed in thein the vertex vertex (the (the vertex vertex will will not benot used be used to form to form the next the cubenext cube for 3D for object 3D object rendering), rendering), whereas whereas the value the ofvalue 1 implies of 1 implies that the that vertex the containsvertex contains the information the information and will and be will used be to used configure to configure the next the cube next as cube the connecting as the connecting vertex. vertex.

Figure 3. The configuration of marching cubes based on [6]. Figure 3. The configuration of marching cubes based on [6]. The first step of vertex configuration to form the cube begins with connecting the upper slice; the The first step of vertex configuration to form the cube begins with connecting the upper slice; first four vertices locate in lower slice and the second four vertices will be in the upper one as illustrated the first four vertices locate in lower slice and the second four vertices will be in the upper one as in Figure4. Next, the algorithm will determine the inner cut within the cube by using these criterions: illustrated in Figure 4. Next, the algorithm will determine the inner cut within the cube by using these criterions:The vertex will be the inner vertex if the vertex value is greater than or equal to the isosurface • • Thevalue; vertex then will assign be the “0” inner to the vertex vertex. if the vertex value is greater than or equal to the isosurface value; The vertex will be the outer vertex if the vertex value is less than the isosurface value; then assign • then assign “0” to the vertex. • The“1” tovertex the vertex.will be the outer vertex if the vertex value is less than the isosurface value; then assign “1”Therefore, to the vertex. they will have 28 = 256 combinations per one cube (2 = two values of 0, 1; 8 = number of verticesTherefore, in 1 cube). they will have 28 = 256 combinations per one cube (2 = two values of 0, 1; 8 = number of vertices in 1 cube).

J. Imaging 2020, 6, x FOR PEER REVIEW 4 of 12 J. Imaging 2020, 6, x FOR PEER REVIEW 4 of 12 J. Imaging 2020, 6, 88 4 of 12 J. Imaging 2020, 6, x FOR PEER REVIEW 4 of 12

Figure 4. The connection of vertices to form the cube. Figure 4. The connection of vertices to form the cube. Figure 4. The connection of vertices to form the cube. The third step of marchingFigure cubes4. The isconnection the creating of vertices of index; to form the the index cube. will be used to match the configurationTheThe thirdthird of stepstep 15 fundamental ofof marchingmarching cubescubescubes isinis theFigurethe creatingcreating 3. Figure ofofindex; index; 5a shows thethe index indexthe configuration willwill bebe usedused of toto indexmatch match and thethe FigureconfigurationconfigurationThe 5b showsthird of ofstep the 1515 fundamentalexampleoffundamental marching of index cubescubes that inisin thecontains FigureFigure creating3 .3. the Figure Figure valueof index;5a 5a = shows 01000001,shows the theindex the configuration this configuration will index be usedmatches of toof index matchindex the andcube andthe no.FigureconfigurationFigure 4 in5 b5bFigure shows shows 3.of the Itthe15 means examplefundamental example that of ofthe index index cubescube that that will in contains Figurecontains be sheared 3. the theFigure value offvalue at 5a =edge = 01000001, shows01000001, no. the1, 4,this thisconfiguration 9 (e1,index index e4,matches e9)matches and of index edgethe thecube cube no.and 6,no.Figureno. 7, 4124 inin (e6,5b FigureFigure shows e7, 3e12), .3. Itthe It means respectively.means example that that of the the indexIn cube cubethe that last will will containsstep be be sheared shearedof marching the ovalue offff at at cubes, edge =edge 01000001, no. no.the 1, 1,al 4, gorithm4,this 99 (e1, (e1,index e4, e4,will matches e9)e9) determine andand edgeedgethe cube the no.no. direction6,no.6, 7,7, 4 1212 in (e6, (e6,Figure of e7,thee7, e12), e12),3.cut It usingmeans respectively.respectively. normal that the Invector In cube thethe last (seelastwill step stepFigurebe shearedof ofmarching marching6). off at cubes, cubes,edge no.the the 1,algorithm al 4,gorithm 9 (e1, e4, willwill e9) determinedetermine and edge theno.the direction of the cut using normal vector (see Figure 6). direction6, 7, 12 (e6, of thee7, e12), cut using respectively. normal vectorIn the (seelast step Figure of 6marching). cubes, the algorithm will determine the direction of the cut using normal vector (see Figure 6).

(a) (b) (a) (b) Figure 5. (a) The configuration of index; (b) The example of index contains value “01000001” and the Figure 5. (a) The configuration(a) of index; (b) The example of index contains value(b) “01000001” and the triangularFigure 5. (cross-sectiona) The configuration according of toindex; index (b value.) The example of index contains value “01000001” and the triangularFiguretriangular 5. ( cross-section across-section) The configuration according according of toindex; to index index (b value.) value. The example of index contains value “01000001” and the triangular cross-section according to index value.

Figure 6. TheThe direction direction of of the the triangular triangular cross-section determined by normal vector [15]. [15]. Figure 6. The direction of the triangular cross-section determined by normal vector [15]. 3. Reading the Intensity Value of CT Images for 3D Rendering 3. Reading Figurethe Intensity 6. The direction Value ofof CTthe triangularImages for cross-section 3D Rendering determined by normal vector [15]. 3. Reading the Intensity Value of CT Images for 3D Rendering The first step for obtaining the intensity value of medical images begins with reading the The first step for obtaining the intensity value of medical images begins with reading the coordinates3. Reading andthe Intensity values then Value store of them CT Images in the data for structure3D Rendering of the system, e.g., the binary image with coordinatesThe first and step values for then obtaining store them the inintensity the data value structure of medical of the system, images e.g., begins the binary with imagereading with the dimensioncoordinates of and 256 values256 then will bestore read them and in kept the data in the structure array. The of the input system, array e.g., will the be binary manipulated image with for dimensionThe first of 256 step × 256for willobtaining be read the and intensity kept in thevalue array. of medical The input images array beginswill be withmanipulated reading forthe marching cubes and histogram pyramids. Figure7 shows the binary image and grid structure used for marchingcoordinatesdimension cubes of and 256 and values × 256histogram then will storebe pyraread themmids. and in kepttheFigure data in 7the structure shows array. the Theof binary the input system, image array e.g., andwill the grid be binary manipulated structure image used with for dividingmarching image cubes into and 128 histogram128 segments. pyramids. Figure 7 shows the binary image and grid structure used fordimension dividing of image 256 ×into 256 128 ×will × be128 read segments. and kept in the array. The input array will be manipulated for marchingfor dividing cubes image and into histogram 128 × 128 pyra segments.mids. Figure 7 shows the binary image and grid structure used for dividing image into 128 × 128 segments.

J. Imaging 2020, 6, x FOR PEER REVIEW 5 of 12 J. Imaging 2020, 6, 88 5 of 12 J. Imaging 2020, 6, x FOR PEER REVIEW 5 of 12

Figure 7. The input image with 128 × 128 segments. Figure 7. The input image with 128 128 segments. Figure 7. The input image with 128× × 128 segments. The marching cubes algorithm will generate 3D visualization of 2D binary images by The marching cubes algorithm will generate 3D visualization of 2D binary images by manipulating manipulatingThe marching in form cubes of width algorithm x height will of image;generate e.g., 3D in visualizationMRI, the resolution of 2D is binarydetermined images by theby numberin form of ofpixels width in x a height specified of image; FOV e.g.,(Field-of-view), in MRI, the resolution for FOV is = determined 320, the input by the image number with of dimension pixels manipulatingin a specified in FOVform (Field-of-view), of width x height for FOV of image;= 320, thee.g., input in MRI, image the with resolution dimension is of determined 320 320 will by the of 320 × 320 will obtain the amount of data = (320 + 1) × (320 + 1) = 103,041; these data ×will be stored numberobtain of thepixels amount in a specified of data = (320FOV+ (Field-of-view),1) (320 + 1) = for103,041; FOV these= 320, data the willinput be image stored with in the dimension array × ofin 320the[0, array×... 320, 103,040] [0,will …, obtain .103,040]. The datathe Theamount that data will of that be data kept will = in be(320 the ke array+pt 1) in × the is(320 the array + intensity 1) is= the103,041; value intensity ofthese input value data image; of will input inbe the storedimage; inin the thegray-scale array gray-scale [0, image,…, image, 103,040]. the the range The range ofdata gray-scaleof thatgray-scale will values be values kept are in varyingare the varying array from is from the 0 to intensity 0 255 to 255 (256 (256value intensity intensity of input values). values). image; inThe the Therendering gray-scale rendering process image, process willthe will range be be computed computed of gray-scale starting starting values from from are the the varying first first slideslide from untiluntil 0 to the 255the last last(256 slide slide intensity of of images images values). (k, The…, k(rendering k+, ...1) as, k illustrated+ 1) process as illustrated willpreviously be previously computed in Figure in Figurestarting 4. Figure4. Figurefrom 8 showsthe8 shows first the theslide CT CT untilimages images the sequence.sequence. last slide of images (k, …, k + 1) as illustrated previously in Figure 4. Figure 8 shows the CT images sequence.

Figure 8. The CT images sequence used in 3D medical rendering. Figure 8. The CT images sequence used in 3D medical rendering. 4. Histogram PyramidsFigure 8. The CT images sequence used in 3D medical rendering. 4. HistogramOne major Pyramids problem of manipulating the large amount of image data is sparse matrix. The main 4. HistogramideaOne of major histogram Pyramids problem pyramids of manipulating is used for preventing the large sparseamount matrix of image [16–18 data]. The is sparse matrixmatrix. can The be main occurred during the process of connecting image slides, many elements in sparse matrix can be spread idea Oneof histogram major problem pyramids of manipulating is used for preventing the large amou sparsent ofmatrix image [16–18]. data is The sparse sparse matrix. matrix The can main be out and most of them will not be used for generating the voxel. Figure9 shows the index of histogram ideaoccurred of histogram during thepyramids process is ofused connecting for preventing image sparseslides, matrixmany elements[16–18]. The in sparsesparse matrix cancan bebe pyramids created from vertices, e.g., V000 0, V100 1, V010 2, V001 3, V101 4, V011 5, spread out and most of them will not be used→ for generating→ the→ voxel. →Figure 9 shows→ the→ index of occurredV110 during6, V111 the 7,process and the of last connecting index (index image no. 8) s willlides, be keptmany as theelements starting in point sparse of the matrix traversal can be histogram→ pyramids→ created from vertices, e.g., V000 → 0, V100 → 1, V010 → 2, V001 → 3, V101 → 4, spreadof histogramout and most pyramids. of them will not be used for generating the voxel. Figure 9 shows the index of histogramV011 → 5, pyramids V110 → 6, created V111 → from 7, and vertices, the last e.g., index V000 (index → 0, V100 no. 8) → will 1, V010 be kept → 2,as V001 the starting → 3, V101 point → 4,of V011the traversal → 5, V110 of histogram→ 6, V111 pyramids. → 7, and the last index (index no. 8) will be kept as the starting point of the traversal of histogram pyramids.

J. Imaging 2020, 6, x FOR PEER REVIEW 6 of 12

J. Imaging 2020, 6, 88 6 of 12 J. Imaging 2020, 6, x FOR PEER REVIEW 6 of 12

Figure 9. The vertices of cubes used for creating the histogram pyramids index.

If V101 (index no. 4) contains maximum intensity value, the histogram pyramids method can be traversed as shown inFigure Figure 9. The 10. vertices In this ofcubes example, used for a creating 2D array the histogram contains pyramids nine elements index. (the index range Figure 9. The vertices of cubes used for creating the histogram pyramids index. = [0…8]) used to represent nine entries of 2D image. Note that x will be terminated when the If V101 (index no. 4) contains maximum intensity value, the histogram pyramids method can summation of index pointer exceeds the maximum value of the index range (8). In the example in If V101be traversed (index asno. shown 4) contains in Figure maximum 10. In this intensit example,y a value, 2D array the contains histogram nine elementspyramids (the method index can be Figure 10, the traversal path is started with index no. 4, and L2 will be set to 0, 8 (0 + 8 ≥ 8; thus, this traversedrange as shown= [0 ... in8]) Figure used to 10. represent In this nine example, entries ofa 2D image.array contains Note that xninewill elements be terminated (the when index range point is fit).the summationThe list will of index be lower pointer down exceeds to theL1 maximumand retain value start of the= 0. index In L1: range the (8). upper In the left example element, the = [0…8])in used Figure to 10 ,represent the traversal nine path isentries started of with 2D index image. no. 4, Note and L2 that will bex will set to be 0, 8terminated (0 + 8 8; thus, when the index range will be set to 0, 3; the upper right element, the index range will be set to≥ 3, 5 (3 + 5 ≥ 8; summationthis pointof index is fit). pointer The list willexceeds be lower the down maximum to L1 and va retainlue of start the= 0.index In L1: range the upper (8). leftIn element,the example in thus, this point is fit). The list will be lower down to L0 and retain start = 3. In L0: the upper left Figure 10,the the index traversal range will path be set is to started 0, 3; the with upper index right element, no. 4, and the index L2 will range be will set be to set 0, to 8 3,(0 5 + (3 8+ ≥5 8; 8thus,; this element = empty; the upper right element, the index range will be set to 3, 4; the lower left≥ element, point is thus,fit). The this pointlist will is fit). be Thelower list willdown be lowerto L1 downand retain to L0 and start retain = 0. start In L1:= 3. the In L0:upper the upperleft element, left the the index range will be set to 4, 5 (4 + 5 ≥ 8; this point is fit). The resulting point = (2, 1). The resulting index rangeelement will= empty;be set theto 0, upper 3; the right upper element, right the el indexement, range the will index be set range to 3, 4; will the lower be set left to element, 3, 5 (3 + 5 ≥ 8; point listthe will index be rangeused willlater be in set marching to 4, 5 (4 + 5cubes8; this process. point is fit). The resulting point = (2, 1). The resulting ≥ thus, thispoint point list willis fit). beused The later list inwill marching be lower cubes down process. to L0 and retain start = 3. In L0: the upper left element = empty; the upper right element, the index range will be set to 3, 4; the lower left element, the index range will be set to 4, 5 (4 + 5 ≥ 8; this point is fit). The resulting point = (2, 1). The resulting point list will be used later in marching cubes process.

Figure 10. Histogram pyramids traversal. Figure 10. Histogram pyramids traversal. 5. Implementation 5. ImplementationThe CT/ MRI of 32/64/128 slides must be provided to use as input images. Figure 11 shows the MRI slides of human knee. The CT/MRITwo important of 32/64/128 parameters slidesFigure will must 10. be read:Histogram be theprovided coordinates pyramids to use and traversal. theas input intensity images. values; theFigure point 11 list shows of the MRI slideshistogram of human pyramids knee. will be computed for marching cubes process. The user interface of the program 5. ImplementationTwois important shown in Figure parameters 12, the program will be may read: prompt the to coor the userdinates for rotate and the the result intensity 3D object values; and toggle the to point list the wireframe mode. The screen captured of the program is also shown in Figure 12. of histogram pyramids will be computed for marching cubes process. The user interface of the The CT/MRI of 32/64/128 slides must be provided to use as input images. Figure 11 shows the program is shown in Figure 12, the program may prompt to the user for rotate the result 3D object MRI slides of human knee. and toggle to the wireframe mode. The screen captured of the program is also shown in Figure 12. Two important parameters will be read: the coordinates and the intensity values; the point list of histogram pyramids will be computed for marching cubes process. The user interface of the program is shown in Figure 12, the program may prompt to the user for rotate the result 3D object and toggle to the wireframe mode. The screen captured of the program is also shown in Figure 12.

J. Imaging 2020, 6, 88 7 of 12 J. Imaging 2020, 6, x FOR PEER REVIEW 7 of 12

Figure 11. Cont.

J. Imaging 2020, 6, 88 8 of 12 J. Imaging 2020,, 6,, xx FORFOR PEERPEER REVIEWREVIEW 8 of 12

Figure 11. The image slides used as input data. Figure 11. The image slides used as input data.

Figure 12. The screen captured of 3D medical visualization program.

Figure 12. The screen captured of 3D medical visualization program.

J. Imaging 2020, 6, 88 9 of 12 J. Imaging 2020, 6, x FOR PEER REVIEW 9 of 12

6. Results As mentionedmentioned earlierearlier in in Section Section4, the4, the histogram histogram pyramids pyramids can reduce can reduce the redundant the redundant voxels whichvoxels arewhich not usedare not for generatingused for generating 3D surface. 3D These surface. unused These voxels unused affect forvoxels causes affect of surface for causes roughness of surface in 3D reconstruction.roughness in 3D Figure reconstruction. 13 shows the Figure comparison 13 shows of surfacethe comparison rendering of between surface therendering marching between cubes [the14] andmarching the marching cubes [14] cubes and withthe marching histogram cubes pyramids, with histogram by reducing pyramids, the unused by reducing voxel, the the marching unused cubesvoxel, withthe marching histogram cubes pyramids with histogram can generate pyramids the smooth can generate surface. the To smooth measure surface. the smoothness To measure of surface,the smoothness [19] proposed of surface, the edge [19] pointproposed computation the edge and point local computation window to and calculate local thewindow distance to calculate between the distance vertices. between The average the vertices. curvature The value average is calculated curvature for value each is vertex,calculated and for it correspondseach vertex, toand the it meancorresponds of the curvatureto the mean of allof the vertices curvature from itsof all local vertices window. from The its curvaturelocal window. value The is the curvature parameter value to measureis the parameter the roughness to measure of 3D the mesh roughness model [of19 3D]. Generally, mesh model the [19]. common Generally, parameter the common used to parameter determine theused curvature to determine is mesh the density curvature (vertices). is mesh In density [19,20], (ver thetices). work In already [19,20], proved the work that aalready higher proved mesh density that a associatedhigher mesh to density the roughness associated of 3D to meshthe roughness model. Therefore, of 3D mesh the model. model Therefore, generated the using model the traditionalgenerated marchingusing the traditional cubes will havemarching higher cubes mesh will density have higher than the mesh model density generated than the using model the generated marching cubesusing withthe marching histogram cubes pyramids. with histog Table1ram shows pyramids. the comparison Table 1 shows of mesh the densities comparison between of mesh the marching densities cubesbetween [14 the] and marching the marching cubes cubes[14] and with the histogram marching pyramids. cubes with histogram pyramids.

(a) (b)

Figure 13.13. (a(a)) The The surface surface rendering rendering using using the traditionalthe traditional marching marching cubes [14cubes]; (b) [14]; the surface (b) the rendering surface usingrendering the marchingusing the cubesmarching with cu histogrambes with histogram pyramids. pyramids.

Table 1. The experimental results. The system was tested using six models; Table 1 shows the results of experiment, the rendering times of marching cubesMesh compared Density (Vertices)with the rendering times Rendering of marching Times (Sec.) cubes with histogram pyramids. The paper also tested modelsMarching by Cubesprinting them with 3D printerMarching using Cubes printing% resolution Times Model Marching Marching = 200 µm. The results of rendering withmodels Histogram and their 3D printings are shownwith Histogram in Figure 14.Reduced Cubes [14] Cubes [14] Pyramids Pyramids Sphenoid 45,440Table 38,800 1. The experimental 0.345 results. 0.295 14.49 Right-temporal 39,600 32,200 0.338 0.277 18.04 Mesh Density (Vertices) Rendering Times (Sec.) Right-maxilla 38,560 31,900 0.324 0.268 17.28 Marching Cubes % Times ModelEthmoid Marching 49,800 43,800Marching 0.382 Marching Cubes 0.333 with 12.82 with Histogram Reduced Ankle boneCubes [14] 63,120 52,900Cubes [14] 0.595 Histogram 0.500Pyramids 15.96 Teeth 69,760Pyramids 59,200 0.467 0.397 14.98 Sphenoid 45,440 38,800 0.345 0.295 14.49 - - - - Average 15.59 Right- 39,600 32,200 0.338 0.277 18.04 temporal Right-The system was tested using six models; Table1 shows the results of experiment, the rendering 38,560 31,900 0.324 0.268 17.28 timesmaxilla of marching cubes compared with the rendering times of marching cubes with histogram pyramids. TheEthmoid paper also tested49,800 models by printing43,800 them with 0.382 3D printer using printing 0.333 resolution = 12.82200 µm. Ankle The results of rendering63,120 models and52,900 their 3D printings 0.595 are shown in Figure 0.500 14 . 15.96 bone Teeth 69,760 59,200 0.467 0.397 14.98 - - - - Average 15.59

J. Imaging 2020, 6, 88 10 of 12 J. Imaging 2020, 6, x FOR PEER REVIEW 10 of 12

Figure 14. Cont. J. Imaging 2020, 6, 88 11 of 12 J. Imaging 2020, 6, x FOR PEER REVIEW 11 of 12

FigureFigure 14.14. 3D rendering rendering results results and and their their 3D 3D printing. printing.

7. Conclusions7. Conclusions and and Future Future WorksWorks ThisThis paper paper presents presents thethe methodmethod for 3D 3D visu visualizationalization using using marching marching cubes cubes and andhistogram histogram pyramids.pyramids. The The input input imageimage slidesslides of CT/MRI CT/MRI were were fed fed into into the the system; system; two two important important parameters, parameters, coordinatescoordinates and and intensity intensity values values of of image, image, were were computed computed using using histogram histogram pyramids pyramids to to generate generate point list;point the systemlist; the later system used later point used list point for marchinglist for ma cubesrching process. cubes process. The relationships The relationships of voxel of amongvoxel the layersamong of medical the layers images of medical (k and imagesk + 1) were(k and manipulated k + 1) were manipulated to create the to sequence create the of sequence cubes and of form cubes up 3D object.and Theform paper up 3D also object. shows The the paper comparison also shows between the comparison the rendering between times the of marchingrendering cubestimes andof the marching cubes and the rendering times of marching cubes with histogram pyramids. The paper also rendering times of marching cubes with histogram pyramids. The paper also shows the smoothness shows the smoothness of 3D object generated from the marching cubes with histogram pyramids. of 3D object generated from the marching cubes with histogram pyramids. The results show that The results show that the mesh density is the major factor affecting the experiment. Table 1 shows the mesh density is the major factor affecting the experiment. Table1 shows the time consuming for the time consuming for generating 3D model can be reduced by 15.59% in average. The complexity generatingof algorithm 3D modelof histogram can be pyramids reduced for by 15.59%reducing in sparse average. matrix The gives complexity O (N) + M of (log algorithm N), where of histogram N is pyramidsnumber forof elements reducing and sparse M is matrixnumber givesof lists. O Th (N)e recommendations+ M (log N), where of future N is numberworks such of elementsas improve and M is numberthe histogram of lists. pyramids The recommendations algorithm and conduct of future the re workssearch using such terrain as improve data in the 3D histogram computer game. pyramids algorithm and conduct the research using terrain data in 3D computer game. Funding: This research was funded by the King Mongkut’s University of Technology North Bangkok. Contract Funding:no. KMUTNB-GOV-60-53.This research was funded by the King Mongkut’s University of Technology North Bangkok. Contract no. KMUTNB-GOV-60-53. Conflicts of Interest: The author declares no conflict of interest. Conflicts of Interest: The author declares no conflict of interest. References References 1. Nakayama, Y.; Tanida, Y. Atlas of Visualization; CRC Press: Boca Raton, FL, USA 1997; pp. 213–214. 1. 2. Nakayama,Udupa, J.K. Y.; Tanida,Three-dimensional Y. Atlas of Visualization visualization; CRC and Press: analysis Boca methodologies: Raton, FL, USA, A 1997;current pp. perspective. 213–214. 2. Udupa,Radiographics J.K. Three-dimensional 1999, 19, 783–806. visualization and analysis methodologies: A current perspective. Radiographics

3. 1999Birkfellner,, 19, 783–806. W. Applied [CrossRef Medical][PubMed Image Processing:] A Basic Course; CRC Press: Boca Raton, FL, USA, 2016; pp. 262–265. 3. Birkfellner, W. Applied Medical Image Processing: A Basic Course; CRC Press: Boca Raton, FL, USA, 2016; 4. Helminen, H.; Alakuijala, J.; Laitinen, J.; Sallinen, S. Constant Z line texture mapping in interactive pp. 262–265. visualization of medical images. In Proceedings of the 17th International Conference of the Engineering in 4. Helminen, H.; Alakuijala, J.; Laitinen, J.; Sallinen, S. Constant Z line texture mapping in interactive Medicine and Biology Society, IEEE, Montreal, QC, Canada, 20–23 September 1995; pp. 1039–1040. 5. visualizationGonzález Izard, of medical S.; Sánchez images. Torres, In Proceedings R.; Alonso of Plaza, the 17th Ó.; InternationalJuanes Méndez, Conference J.A.; García-Peñalvo, of the Engineering F.J. in MedicineNextmed: and Automatic Biology Society,Imaging IEEE, Segmentation, Montreal, 3D QC, Reco Canada,nstruction, 20–23 and September 3D Model 1995; Visualization pp. 1039–1040. Platform 5. GonzUsingález Augmented Izard, S.; and Sánchez Virtual Torres,Reality. R.;Sensors Alonso 2020, 20 Plaza,, 2962.Ó .; Juanes Méndez, J.A.; García-Peñalvo, F.J. 6. Nextmed:Lorensen, Automatic W.E.; Cline, Imaging H.E. Marching Segmentation, cubes: A 3Dhigh Reconstruction, resolution 3D surface and 3Dconstruction Model Visualization algorithm. ACM Platform UsingSIGGRAPH Augmented Comput. and Graph. Virtual 1987 Reality., 21, 163–169.Sensors 2020, 20, 2962. [CrossRef][PubMed] 6. 7. Lorensen,Levoy, M. W.E.; Display Cline, of surfaces H.E. Marching from volume cubes: data. A highIEEE Comput. resolution Graph. 3D Appl. surface 1988 construction, 8, 29–37. algorithm. ACM 8. SIGGRAPHDrebin, R.A.; Comput. Carpenter, Graph. L.; 1987Hanrahan,, 21, 163–169. P. Volume [CrossRef rendering.] ACM SIGGRAPH Comput. Graph. 1988, 22, 65– 7. Levoy,74. M. Display of surfaces from volume data. IEEE Comput. Graph. Appl. 1988, 8, 29–37. [CrossRef] 8. 9. Drebin,Sethian, R.A.; J.A. Carpenter,Fast Marching L.; Methods. Hanrahan, SIAM P. Volume Rev. 1999 rendering., 41, 199–235.ACM SIGGRAPH Comput. Graph. 1988, 22,

10.65–74.Long, [CrossRef Z.; Nagamune,] K. A Marching Cubes Algorithm: Application for Three-dimensional Surface Reconstruction Based on Endoscope and Optical Fiber. Information 2015, 18, 1425–1437 9. Sethian, J.A. Fast Marching Methods. SIAM Rev. 1999, 41, 199–235. [CrossRef] 10. Long, Z.; Nagamune, K. A Marching Cubes Algorithm: Application for Three-dimensional Surface Reconstruction

Based on Endoscope and Optical Fiber. Information 2015, 18, 1425–1437. J. Imaging 2020, 6, 88 12 of 12

11. Messmer, P.; Matthews, F.; Jacob, A.L.; Kikinis, R.; Regazzoni, P.; Noser, H. A CT Database for Research, Development and Education: Concept and Potential. J. Digit. Imaging 2007, 20, 17–22. [CrossRef][PubMed] 12. Zhong, D.; Zhang, J.; Wang, L. Fast Implicit Surface Reconstruction for the Radial Basis Functions Interpolant. Appl. Sci. 2019, 9, 5335. [CrossRef] 13. Gong, S.; Newman, T.S. A corner feature sensitive marching squares. In Proceedings of the IEEE Southeastcon, IEEE, Jacksonville, FL, USA, 4–7 April 2013; pp. 1–6. 14. Visutsak, P.; Pensiri, F.; Chaowalit, O. Smooth voxel surface for medical volumetric rendering. In Proceedings of the International Conference on Image and Video Processing, and Artificial Intelligence. International Society for Optics and Photonics, Shanghai, China, 23–25 August 2019; p. 113210Y. 15. Marching Cubes Algorithm. Available online: http://iqc.udg.es/cat/similarity/ASA/mca.html (accessed on 28 June 2020). 16. Ziegler, G.; Theobalt, C.; Seidel, H.; Kobbelt, L.; Kuhlen, T.W.; Aach, T.; Westermann, R. On-the-fly Point Clouds through Histogram Pyramids. In 11th International Fall Workshop on Vision, Modeling and Visualization; IOS Press: Amsterdam, The Netherlands, 2006. 17. Dyken, C.; Ziegler, G.; Theobalt, C.; Seidel, H.P.High-speed marching cubes using histopyramids. In Forum; Blackwell Publishing Ltd.: Oxford, UK, 2008; pp. 2028–2039. 18. Haque, H.F.; Rahman, A.; Ashraf, M.S.; Shatabda, S. Wavelet and pyramid histogram features for image-based leaf detection. In Emerging Technologies in Data Mining and Information Security; Springer: Singapore, 2019; pp. 269–278. 19. Lavoué, G. A local roughness measure for 3D meshes and its application to visual masking. ACM Trans. Appl. Percept. (TAP) 2009, 5, 1–23. [CrossRef] 20. Wang, K.; Torkhani, F.; Montanvert, A. A fast roughness-based approach to the assessment of 3D mesh visual quality. Comput. Graph. 2012, 36, 808–818. [CrossRef]

© 2020 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).