JP2019164619A - Ray casting program, search control data, search control data generation method, and ray casting device - Google Patents

Ray casting program, search control data, search control data generation method, and ray casting device Download PDF

Info

Publication number
JP2019164619A
JP2019164619A JP2018052411A JP2018052411A JP2019164619A JP 2019164619 A JP2019164619 A JP 2019164619A JP 2018052411 A JP2018052411 A JP 2018052411A JP 2018052411 A JP2018052411 A JP 2018052411A JP 2019164619 A JP2019164619 A JP 2019164619A
Authority
JP
Japan
Prior art keywords
voxel
coordinate
starting point
image
ray casting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2018052411A
Other languages
Japanese (ja)
Other versions
JP6443574B1 (en
Inventor
茂出木 敏雄
Toshio Modegi
敏雄 茂出木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dai Nippon Printing Co Ltd
Original Assignee
Dai Nippon Printing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dai Nippon Printing Co Ltd filed Critical Dai Nippon Printing Co Ltd
Priority to JP2018052411A priority Critical patent/JP6443574B1/en
Application granted granted Critical
Publication of JP6443574B1 publication Critical patent/JP6443574B1/en
Publication of JP2019164619A publication Critical patent/JP2019164619A/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

To minimize an operation load when generating a volume rendering image using a ray casting method.SOLUTION: A ray casting program according to the present invention can adopt a method of: previously calculating a coordinate conversion parameter to be used for subjecting coordinates of each voxel in a viewpoint coordinate system in which a voxel image is viewed from a viewpoint to coordinate conversion into a voxel coordinate system in which the voxel is defined; carrying out coordinate conversion only for a voxel required when previously searching for origin coordinates of virtual light for performing ray casting processing using the coordinate conversion parameter; and carrying out coordinate conversion only for a voxel required for calculating a pixel value of a volume rendering image in the ray casting processing. The number of times of coordinate conversion can be reduced, and an operation load can be suppressed, as compared to well-known methods of, upon previously converting all voxels of a voxel image into the viewpoint coordinate system to generate a voxel data structure converted into the viewpoint coordinate system, searching for origin coordinates and ray casting processing are performed.SELECTED DRAWING: Figure 2

Description

本開示は、レイキャスティング法を用いてボリュームレンダリング画像を生成する技術に関する。   The present disclosure relates to a technique for generating a volume rendering image using a ray casting method.

医療分野においては、CT装置やMRI装置によって取得した対象物のスライス画像から、当該対象物の3次元画像を生成する場合がある。このような画像をボリュームレンダリング画像と呼ぶ。ボリュームレンダリング画像を生成する手法として、レイキャスティング法と呼ばれるものがある。   In the medical field, a three-dimensional image of an object may be generated from a slice image of the object acquired by a CT apparatus or an MRI apparatus. Such an image is called a volume rendering image. As a method for generating a volume rendering image, there is a method called a ray casting method.

レイキャスティング法においては、ボクセル値に基づいて定義された色値(具体的には、RGB値)と不透明度(具体的には、α値)を有するボクセルを3次元配置する。視点からボクセル空間に対して仮想光(レイ)を照射することにより、各ボクセルにおいてボクセル値に基づいて定義された色値と不透明度に応じて減衰する光強度とボリュームレンダリング画像の画素の輝度値(具体的には、RGB値)を、視線方向に沿ってそれぞれ算出する。これにより、対象物の3次元構造を視点から見たときのボリュームレンダリング画像を作成することができる。ボリュームレンダリング画像は、視点から見た任意深さにおいて生成することができる。さらに各ボクセルに対してボクセル値に基づいて色値と不透明度を定義した配列(カラーマップ、オパシティカーブなどと呼ぶ)をマッピングすることにより、一部の組織を透明にしたカラー画像を生成することができる。   In the ray casting method, voxels having color values (specifically, RGB values) and opacity (specifically, α values) defined based on the voxel values are three-dimensionally arranged. By irradiating virtual light (ray) from the viewpoint to the voxel space, the color value defined based on the voxel value in each voxel, the light intensity attenuated according to the opacity, and the luminance value of the pixel of the volume rendering image (Specifically, RGB values) are calculated along the line-of-sight direction. This makes it possible to create a volume rendering image when the three-dimensional structure of the object is viewed from the viewpoint. The volume rendering image can be generated at an arbitrary depth viewed from the viewpoint. Furthermore, by mapping an array (referred to as a color map, opacity curve, etc.) that defines color values and opacity based on the voxel values for each voxel, a color image in which a part of the tissue is made transparent is generated. Can do.

下記特許文献1は、レイキャスティング法を用いてボリュームレンダリング画像を生成する技術を開示している。同文献は、『3次元ボクセル空間に対する任意の視点方向からのレイキャスティング演算処理を効率良く実施する。』ことを課題として、『物体の内部組織の3次元画像を得るスライス画像の3次元画像表示方法において、3次元ボクセル空間1を六面体とし、その各面を構成する8つの頂点を視点方向4によって3次元座標変換して視点方向に垂直な投影面での8つの頂点の平面座標を求め、8つの頂点の平面座標から3次元ボクセル空間を投影面に投影した場合の投影面上における各面8を求め、投影面上における投影された各面を含む矩形の投影領域7を定め、投影領域内における各面を零値でない任意の輝度値に塗り潰し、視点方向から3次元ボクセル空間に対してレイキャスティング処理を実施するときに、投影領域のうち輝度値が零値を除く各位置に対してのみ、レイキャスティング処理を実施する。』という技術を開示している(要約参照)。   Patent Document 1 below discloses a technique for generating a volume rendering image using a ray casting method. The document “Efficiently performs ray casting calculation processing from an arbitrary viewpoint direction for a three-dimensional voxel space. "In the three-dimensional image display method for obtaining a three-dimensional image of the internal tissue of the object, the three-dimensional voxel space 1 is a hexahedron, and the eight vertices constituting each surface are defined by the viewpoint direction 4". Three-dimensional coordinate transformation is performed to obtain the plane coordinates of the eight vertices on the projection plane perpendicular to the viewpoint direction, and each plane 8 on the projection plane when the three-dimensional voxel space is projected onto the projection plane from the plane coordinates of the eight vertices. A rectangular projection region 7 including each projected surface on the projection surface is defined, each surface in the projection region is filled with an arbitrary non-zero luminance value, and a ray is projected from the viewpoint direction to the three-dimensional voxel space. When performing the casting process, the ray casting process is performed only for each position in the projection area where the brightness value is not zero. Is disclosed (see summary).

特開平11−175743号公報Japanese Patent Laid-Open No. 11-175743

レイキャスティング法は原則として、ボリュームレンダリング画像の全ての画素について、各画素の座標よりボクセル画像に向けて仮想光を投射し、座標変換を行いながら仮想光が通過した各ボクセルに定義された色値と不透明度に基づいて仮想光の光強度の減衰を算出するとともに、当該画素の輝度値を算出する。したがって演算負荷が大きい傾向があり、パーソナルコンピュータなどのように比較的演算能力が小さいコンピュータ上でソフトウェア処理のみによって実施することは、一般に困難である。   In principle, the ray casting method projects the virtual light from the coordinates of each pixel toward the voxel image for all the pixels of the volume rendering image, and the color values defined for each voxel through which the virtual light has passed while performing coordinate conversion. Based on the opacity, the attenuation of the light intensity of the virtual light is calculated, and the luminance value of the pixel is calculated. Therefore, the calculation load tends to be large, and it is generally difficult to carry out only by software processing on a computer having a relatively small calculation capability such as a personal computer.

特許文献1は、不透明度が0でないボリュームレンダリング画像の生成に有効なボクセルが存在しない透明なボクセル領域に対するレイキャスティング処理を省略することにより、演算負荷を抑制することを図っている。しかし、たとえ透明なボクセル領域が画像全体に対して占める割合が大きくても、演算負荷を抑制する効果はその透明なボクセル領域の体積割合に限られると考えられる。したがって同文献記載の技術を実装したとしても、ソフトウェア処理のみによって一般的コンピュータ上で実施することは、依然困難であると考えられる。   Japanese Patent Application Laid-Open No. 2004-228688 aims to suppress the calculation load by omitting ray casting processing for a transparent voxel region where there is no voxel effective for generating a volume rendering image whose opacity is not zero. However, even if the ratio of the transparent voxel area to the entire image is large, the effect of suppressing the calculation load is considered to be limited to the volume ratio of the transparent voxel area. Therefore, even if the technique described in the document is implemented, it is still difficult to implement it on a general computer only by software processing.

本開示は、上記のような課題に鑑みてなされたものであり、レイキャスティング法を用いてボリュームレンダリング画像を生成する際の演算負荷をできる限り抑制することを目的とするものである。   The present disclosure has been made in view of the above-described problems, and an object of the present disclosure is to suppress the calculation load when generating a volume rendering image using the ray casting method as much as possible.

本願は上記課題を解決する手段を複数含んでいるが、その一例を挙げるならば、対象物を断層撮影することによって取得した断層画像に対してレイキャスティング法を用いてボリュームレンダリング画像を生成する処理をコンピュータに実行させるレイキャスティングプログラムであって、前記コンピュータに、前記断層画像のボクセル値を基に設定された色値と不透明度を有する前記対象物のボクセル画像を前記断層画像から作成するボクセル画像作成ステップ、前記対象物に対する視点(x,y,0)を基準とした3次元(x,y,z)の視点座標系を、前記ボクセル画像の座標系に変換するパラメータであって、同一の前記視点に対して共通に用いる座標変換パラメータを算出する、座標変換パラメータ算出ステップ、前記視点から前記視点座標系のz方向に沿って、前記座標変換パラメータを用いて座標変換を行いながら前記ボクセル画像を参照することにより、前記視点座標系のz座標のうち不透明度が0ではないものを起点座標として設定する起点座標探索ステップ、前記起点座標を起点として前記視点座標系のz方向に沿って、前記座標変換パラメータを用いて座標変換を行いながら前記ボクセル画像のボクセルの色値と不透明度を取得して前記ボリュームレンダリング画像の画素(x,y)の画素値を算出するレイキャスティングステップ、を実行させるレイキャスティングプログラムである。   The present application includes a plurality of means for solving the above-described problems. For example, a process for generating a volume rendering image using a ray casting method on a tomographic image acquired by tomographic imaging of an object. Is a ray casting program that causes the computer to create a voxel image of the object having color values and opacity set based on the voxel values of the tomographic image from the tomographic image. A parameter for converting a three-dimensional (x, y, z) viewpoint coordinate system based on a viewpoint (x, y, 0) with respect to the object into a coordinate system of the voxel image; A coordinate conversion parameter calculation step for calculating a coordinate conversion parameter used in common for the viewpoint; By referencing the voxel image while performing coordinate conversion using the coordinate conversion parameter along the z direction of the viewpoint coordinate system, the origin coordinates are coordinates whose opacity is not zero among the z coordinates of the viewpoint coordinate system. A starting point coordinate search step that is set as: obtaining the color value and opacity of the voxel of the voxel image while performing coordinate transformation using the coordinate transformation parameter along the z direction of the viewpoint coordinate system starting from the starting point coordinate A ray casting program for executing a ray casting step of calculating a pixel value of a pixel (x, y) of the volume rendering image.

本開示に係るレイキャスティングプログラムによれば、レイキャスティング処理の過程において実施する座標変換処理の演算負荷を抑制し、レイキャスティング処理の全体的な演算負荷を抑制することができる。   According to the ray casting program according to the present disclosure, it is possible to suppress the calculation load of the coordinate conversion process performed in the course of the ray casting process, and to suppress the overall calculation load of the ray casting process.

実施形態1に係るレイキャスティング装置100の構成図である。1 is a configuration diagram of a ray casting apparatus 100 according to Embodiment 1. FIG. レイキャスティング装置100がボリュームレンダリング画像を生成する手順を説明するフローチャートである。It is a flowchart explaining the procedure in which the ray casting apparatus 100 produces | generates a volume rendering image. 座標変換の概念図である。It is a conceptual diagram of coordinate transformation. ステップS230において起点座標探索部123が探索制御テーブルを作成する手順を説明する図である。It is a figure explaining the procedure in which the origin coordinate search part 123 produces a search control table in step S230. ステップS230において起点座標探索部123が各画素において起点座標を探索する手順を説明する図である。It is a figure explaining the procedure in which the starting point coordinate search part 123 searches a starting point coordinate in each pixel in step S230. 起点座標探索部123が各画素において起点座標を探索する手順を説明するフローチャートである。It is a flowchart explaining the procedure in which the starting point coordinate search part 123 searches a starting point coordinate in each pixel. ステップS240においてレイキャスティング処理部124がレイキャスティング処理を実施する手順を説明する図である。It is a figure explaining the procedure in which the ray casting process part 124 implements a ray casting process in step S240. ユーザがマウスをドラッグすることにより視点を変更するときレイキャスティング装置100が生成するボリュームレンダリング画像の例である。It is an example of the volume rendering image which the ray casting apparatus 100 produces | generates, when a user changes a viewpoint by dragging a mouse | mouth. 各機能部をプログラムとして構成した場合の構成例である。It is a structural example at the time of comprising each function part as a program.

<実施の形態1>
図1は、本発明の実施形態1に係るレイキャスティング装置100の構成図である。レイキャスティング装置100は、CT装置やMRI装置によって取得した対象物のスライス画像から、当該対象物の3次元画像(ボリュームレンダリング画像)を生成する装置である。レイキャスティング装置100は、CPU(Central Processing Unit)110、ボクセル画像作成部121、座標変換部122、起点座標探索部123、レイキャスティング処理部124、表示部125、記憶部130を備える。CPU110は演算装置である。表示部125は、作成された情報を出力して表示する表示装置である。記憶部130は、CPU110が用いるデータを格納する記憶装置である。
<Embodiment 1>
FIG. 1 is a configuration diagram of a ray casting apparatus 100 according to Embodiment 1 of the present invention. The ray casting apparatus 100 is an apparatus that generates a three-dimensional image (volume rendering image) of a target object from a slice image of the target object acquired by a CT apparatus or an MRI apparatus. The ray casting apparatus 100 includes a CPU (Central Processing Unit) 110, a voxel image creation unit 121, a coordinate conversion unit 122, a starting point coordinate search unit 123, a ray casting processing unit 124, a display unit 125, and a storage unit 130. The CPU 110 is an arithmetic device. The display unit 125 is a display device that outputs and displays created information. The storage unit 130 is a storage device that stores data used by the CPU 110.

ボクセル画像作成部121、座標変換部122、起点座標探索部123、レイキャスティング処理部124、これらの機能を実装した回路デバイスなどのハードウェアによって構成することもできるし、これらの機能を実装したソフトウェアをCPU110が実行することにより構成することもできる。以下では図1に示すようにCPU110が実行することを前提として説明する。記載の便宜上、これら機能部を動作主体として説明する場合があるが、実際にこれら機能部を実行するのはCPU110であることを付言しておく。これら機能部の詳細については後述する。   The voxel image creation unit 121, the coordinate conversion unit 122, the starting point coordinate search unit 123, the ray casting processing unit 124, and a hardware device such as a circuit device on which these functions are mounted, or software on which these functions are mounted Can also be configured by the CPU 110 executing. The following description is based on the assumption that the CPU 110 executes as shown in FIG. For convenience of description, these functional units may be described as the subject of operation, but it is added that the CPU 110 actually executes these functional units. Details of these functional units will be described later.

図2は、レイキャスティング装置100がボリュームレンダリング画像を生成する手順を説明するフローチャートである。CT装置やMRI装置によって対象物のスライス画像はあらかじめ作成されているものとする。以下図2の各ステップについて説明する。   FIG. 2 is a flowchart for explaining a procedure by which the ray casting apparatus 100 generates a volume rendering image. Assume that a slice image of an object is created in advance by a CT apparatus or an MRI apparatus. Hereinafter, each step of FIG. 2 will be described.

(図2:ステップS210)
ボクセル画像作成部121は、スライス画像からボクセル画像を作成する。ボクセル画像の各ボクセルには、ボクセル値としてスライス画像の画素値(信号値、CT画像の場合はCT値とも呼ばれる)を与え、ボクセル値を基に色値(具体的には、RGB値)と不透明度(具体的には、α値)を持たせる。ボクセル値は例えばCT装置によって取得したCT値で一般に16ビットで与えられるのに対し、色値(RGB値)と不透明度(α値)は各々8ビットの値をもたせボクセルあたり32ビットで表現される。各ボクセルに対してカラーマップを割り当てる場合、各ボクセルのボクセル値を基に色値(RGB値)および不透明度(α値)を与える。各ボクセルに対してカラーマップを割り当てない場合でも、各ボクセルのボクセル値を所定の計算式に基づいて、16ビットのボクセル値を8ビットの色値(RGB値)および不透明度(α値)に変換する。
(FIG. 2: Step S210)
The voxel image creation unit 121 creates a voxel image from the slice image. Each voxel of a voxel image is given a pixel value of a slice image (signal value, also called a CT value in the case of a CT image) as a voxel value, and a color value (specifically, an RGB value) based on the voxel value. It has opacity (specifically, α value). The voxel value is, for example, a CT value acquired by a CT apparatus and is generally given by 16 bits, whereas the color value (RGB value) and the opacity (α value) each have an 8-bit value and are expressed by 32 bits per voxel. The When assigning a color map to each voxel, a color value (RGB value) and opacity (α value) are given based on the voxel value of each voxel. Even if no color map is assigned to each voxel, the 16-bit voxel value is converted into an 8-bit color value (RGB value) and opacity (α value) based on a predetermined calculation formula for the voxel value of each voxel. Convert.

(図2:ステップS220)
座標変換部122は、以後のステップにおいて座標変換を実施する際に用いる座標変換パラメータを算出する。座標変換パラメータの算出S220は、ボクセルに対して仮想光を照射する際、ボクセル単位に逐次座標変換処理を行えるようにするために、視点を基準とする視点座標系を基にボクセル画像が定義されているボクセル座標系にボクセルの3次元座標値を変換し、ボクセル座標系において対応する複数の8近傍のボクセルの色値または/かつ不透明度を補間するための処理である。座標変換の概念図と座標変換パラメータの具体例については後述する。
(FIG. 2: Step S220)
The coordinate conversion unit 122 calculates coordinate conversion parameters used when performing coordinate conversion in subsequent steps. In the coordinate conversion parameter calculation S220, a voxel image is defined based on a viewpoint coordinate system based on the viewpoint in order to perform sequential coordinate conversion processing for each voxel when irradiating virtual light to the voxel. This is a process for converting a three-dimensional coordinate value of a voxel into a voxel coordinate system, and interpolating color values and / or opacity of a plurality of eight neighboring voxels in the voxel coordinate system. A conceptual diagram of coordinate transformation and specific examples of coordinate transformation parameters will be described later.

(図2:ステップS230)
起点座標探索部123は、ボリュームレンダリング画像の各画素において、仮想光の光強度および当該画素の輝度(RGB値)を積算する処理を開始するボクセルの起点座標を、ボリュームレンダリング画像の全画素について算出する。仮想光が通過する全てのボクセルが完全に透明である(不透明度が0である)場合、仮想光の光強度はそのまま維持されてボクセル画像の空間を素通りしてしまうので、レイキャスティング処理は必要ない。したがって本実施形態1においては、視点から見て不透明度が0ではない最初のボクセルの座標を、視線方向に沿って探索することとした。探索により最初に発見される不透明度が0ではないボクセルの座標を起点座標と呼ぶ。本ステップにおいては、ボリュームレンダリング画像の画素(x,y)ごとに、起点座標を探索する。探索結果はボリュームレンダリング画像の画素の座標値(x,y)に対応させて探索制御テーブルとして保持しておく。探索制御テーブルの例については後述する。
(FIG. 2: Step S230)
The origin coordinate search unit 123 calculates, for each pixel of the volume rendering image, the origin coordinates of the voxel that starts the process of integrating the light intensity of the virtual light and the luminance (RGB value) of the pixel for each pixel of the volume rendering image. To do. If all the voxels through which the virtual light passes are completely transparent (opacity is 0), the light intensity of the virtual light is maintained and the voxel image space is passed through, so ray casting processing is necessary Absent. Therefore, in the first embodiment, the coordinates of the first voxel whose opacity is not 0 when viewed from the viewpoint are searched along the line-of-sight direction. The coordinates of the voxel whose opacity that is first found by the search is not zero are called starting point coordinates. In this step, the starting point coordinates are searched for each pixel (x, y) of the volume rendering image. The search result is stored as a search control table in association with the coordinate value (x, y) of the pixel of the volume rendering image. An example of the search control table will be described later.

(図2:ステップS230:補足その1)
ボリュームレンダリング画像の各画素(x,y)は、2次元座標系で定義されている。これに対して、ボクセルの座標系は3次元座標系で定義されており、3次元のボクセル座標系を2次元座標系に投影変換させることによりボリュームレンダリング画像を算出する。各画素(x,y)に対して投影変換されるボクセルは深さ方向に複数個存在するため、同一の座標(x,y)に対応する視線方向に連続する複数個のボクセルをz方向に配置させたものを視点座標系と称す。各画素の輝度値を算出するにあたり、視点座標系においてz方向に仮想光を投射し、仮想光が通過する各ボクセルに対して座標変換を行い、ボクセル画像が定義されている3次元のボクセル座標系における対応するボクセルの色値と不透明度を取得することになる。この座標変換処理において、ステップS220で算出した座標変換パラメータを用いることができる。座標変換処理は起点座標探索部123の制御の下で座標変換部122が実施する。座標変換処理は本ステップにおいて視点座標系のボクセルを参照するごとに実施する。
(FIG. 2: Step S230: Supplement 1)
Each pixel (x, y) of the volume rendering image is defined by a two-dimensional coordinate system. On the other hand, the voxel coordinate system is defined by a three-dimensional coordinate system, and a volume rendering image is calculated by projecting the three-dimensional voxel coordinate system into a two-dimensional coordinate system. Since there are a plurality of voxels projected and converted for each pixel (x, y) in the depth direction, a plurality of voxels continuous in the line-of-sight direction corresponding to the same coordinate (x, y) are arranged in the z direction. The arrangement is called the viewpoint coordinate system. In calculating the luminance value of each pixel, three-dimensional voxel coordinates where a voxel image is defined by projecting virtual light in the z direction in the viewpoint coordinate system, performing coordinate conversion on each voxel through which the virtual light passes You will get the color value and opacity of the corresponding voxel in the system. In this coordinate conversion process, the coordinate conversion parameter calculated in step S220 can be used. The coordinate conversion process is performed by the coordinate conversion unit 122 under the control of the origin coordinate search unit 123. The coordinate conversion process is performed every time the voxel of the viewpoint coordinate system is referred to in this step.

(図2:ステップS230:補足その2)
本ステップにおいては、不透明度が0ではないボクセルを探索するので、ボクセルが有するその他の値(色値)を参照する必要はない。すなわち起点座標探索部123は、本ステップにおいて各ボクセルの不透明度のみを参照し、その他の値(色値)は参照しない。座標変換処理は、視点座標系の単一の座標(x,y,z)のボクセルに対して、ボクセル画像が定義されている3次元のボクセル座標系における対応する座標(x’,y’,z’)のボクセルの色値(RGB)および不透明度を取得する処理であるが、座標値(x’,y’,z’)は実数値で端数をもつため、座標値(x’,y’,z’)の8近傍の整数の座標値に対応する各ボクセルの色値(RGB)および不透明度を補間する演算処理を必要とする。色値の参照を行なわずに不透明度のみを参照する方法をとることにより、座標変換処理の演算負荷が1/4に削減される。
(FIG. 2: Step S230: Supplement 2)
In this step, since the voxel whose opacity is not 0 is searched, it is not necessary to refer to other values (color values) of the voxel. That is, the origin coordinate search unit 123 refers only to the opacity of each voxel in this step, and does not refer to other values (color values). In the coordinate transformation process, for a voxel having a single coordinate (x, y, z) in the viewpoint coordinate system, corresponding coordinates (x ′, y ′, z ′) is a process for acquiring the color value (RGB) and opacity of the voxel, but the coordinate value (x ′, y ′, z ′) is a real value and has a fraction, so the coordinate value (x ′, y An arithmetic process for interpolating the color value (RGB) and opacity of each voxel corresponding to an integer coordinate value in the vicinity of 8 of ', z') is required. By adopting a method of referring only to the opacity without referring to the color value, the calculation load of the coordinate conversion process is reduced to ¼.

(図2:ステップS240)
レイキャスティング処理部124は、ボリュームレンダリング画像の各画素(x、y)において、ステップS230で探索した起点座標を起点として、視点座標系においてz方向に仮想光を投射し、仮想光が通過する各ボクセルに対してボクセル画像が定義されている3次元のボクセル座標系における対応するボクセルの色値と不透明度を用いて仮想光の光強度および当該画素の輝度(RGB値)を積算することにより、ボリュームレンダリング画像の各画素(x,y)の画素値を算出する。本ステップにおいても、視点座標系とボクセル座標系は異なるので、ステップS220で算出した座標変換パラメータを用いて座標変換を行い、視点座標系の各ボクセルに対してボクセル座標系における対応するボクセルの色値と不透明度の双方を算出する必要がある。座標変換処理はレイキャスティング処理部124の制御の下で座標変換部122が実施する。座標変換処理は本ステップにおいても視点座標系のボクセルを参照するごとに実施する。
(FIG. 2: Step S240)
The ray casting processing unit 124 projects, in each pixel (x, y) of the volume rendering image, virtual light in the z-direction in the viewpoint coordinate system, starting from the starting point coordinates searched in step S230, and each virtual light passes through. By integrating the light intensity of the virtual light and the luminance (RGB value) of the pixel using the color value and opacity of the corresponding voxel in the three-dimensional voxel coordinate system in which the voxel image is defined for the voxel, The pixel value of each pixel (x, y) of the volume rendering image is calculated. Also in this step, since the viewpoint coordinate system and the voxel coordinate system are different, coordinate conversion is performed using the coordinate conversion parameter calculated in step S220, and the color of the corresponding voxel in the voxel coordinate system is determined for each voxel in the viewpoint coordinate system. Both value and opacity need to be calculated. The coordinate conversion process is performed by the coordinate conversion unit 122 under the control of the ray casting processing unit 124. The coordinate conversion process is performed in this step every time a voxel in the viewpoint coordinate system is referred to.

(図2:ステップS250)
表示部125は、ステップS240において算出した各画素(x,y)の輝度値(RGB値)を用いて、ボリュームレンダリング画像を出力先の装置またはデバイスに応じて出力する。
(FIG. 2: Step S250)
The display unit 125 outputs a volume rendering image according to the output destination apparatus or device using the luminance value (RGB value) of each pixel (x, y) calculated in step S240.

図3は、座標変換の概念図である。ボリュームレンダリング画像は視点から見た画像であるので、ボリュームレンダリング画像の各画素(x,y)の基準となる視点座標系は必ずしもボクセル座標系とは一致していない。そこで座標変換部122は、ボクセル座標系に定義されているボクセル画像を視点座標系に変換する。しかし、例えば、512×512画素のスライス画像が256枚で構成されるボクセル画像を視点座標系に変換すると、後述するZ方向変倍率を2.0として、x:512×y:512×z:512ボクセルの視点座標系に変換されたボクセルデータ構造体を作成する必要があり、512の3乗回の座標変換が必要になる。これに対して、起点座標の探索を行う際は、不透明度が0でないボクセルが即座に見つかれば、z方向に後続するボクセルに対しては参照する必要が無く、レイキャスティング処理を行う際は、仮想光の光強度が所定の値以下に減衰すれば積算処理を打ち切ることができ、z方向に後続するボクセルに対しては参照する必要が無い。即ち、視点座標系に変換された512の3乗個のボクセルの大半は参照されないため、ボクセル画像の全てのボクセルに対して座標変換を行って保持する必要は無い。そこで、図3の右に示されるような視点座標系に座標変換されたボクセル画像を生成せず、図3の右の下方向の矢印で示される仮想光が通過して参照されるボクセルに限定して、その都度、ボクセル画像が定義されているボクセル座標系に座標変換処理を実行させるようにした。参照されないボクセルに対しては座標変換処理が実行されないため、あらかじめボクセル座標系から視点座標系に変換された全てのボクセルデータ構造体を作成した上で、起点座標探索とレイキャスティング処理を行う公知の方法に比べ、3次元のボクセルデータ構造体を保持するメモリが不要になるとともに、座標変換の回数を削減することができ、メモリアクセス負荷および演算負荷を抑制することができる。   FIG. 3 is a conceptual diagram of coordinate transformation. Since the volume rendering image is an image viewed from the viewpoint, the viewpoint coordinate system serving as a reference for each pixel (x, y) of the volume rendering image does not necessarily match the voxel coordinate system. Therefore, the coordinate conversion unit 122 converts the voxel image defined in the voxel coordinate system into the viewpoint coordinate system. However, for example, when a voxel image composed of 256 slice images of 512 × 512 pixels is converted into the viewpoint coordinate system, x: 512 × y: 512 × z: It is necessary to create a voxel data structure that has been converted to the 512 voxel viewpoint coordinate system, and 512 coordinate transformations are required. On the other hand, when searching for the origin coordinates, if a voxel with an opacity of 0 is immediately found, there is no need to refer to the voxel that follows in the z direction, and when performing the ray casting process, If the light intensity of the virtual light is attenuated to a predetermined value or less, the integration process can be terminated, and there is no need to refer to the voxels that follow in the z direction. That is, most of the 512 cubed voxels converted to the viewpoint coordinate system are not referred to, and therefore it is not necessary to perform coordinate conversion on all the voxels of the voxel image and hold them. Therefore, the voxel image whose coordinates are converted into the viewpoint coordinate system as shown on the right in FIG. 3 is not generated, and limited to the voxel to which the virtual light indicated by the downward arrow in FIG. In each case, the coordinate conversion processing is executed in the voxel coordinate system in which the voxel image is defined. Since the coordinate conversion process is not executed for unreferenced voxels, all voxel data structures converted from the voxel coordinate system to the viewpoint coordinate system are created in advance, and the origin coordinate search and ray casting process are performed. Compared with the method, a memory for holding a three-dimensional voxel data structure is not required, the number of coordinate conversions can be reduced, and a memory access load and a calculation load can be suppressed.

座標変換を実施する際には、様々な座標変換パラメータを用いる。視点座標系とボクセル座標系の位置関係が同じであれば、座標変換パラメータも同じであると考えられる。即ち、起点座標探索部123およびレイキャスティング処理部124において、視点座標系で参照される全てのボクセルに対して、ボクセル座標系に対する座標変換を実施するための座標変換パラメータは同一である。そこで座標変換部122は、ステップS220において座標変換パラメータをあらかじめ算出し、以後のステップにおいてはその座標変換パラメータを共通の座標変換パラメータとして流用する。座標変換パラメータとしては例えば以下のようなものが挙げられる。   When coordinate conversion is performed, various coordinate conversion parameters are used. If the positional relationship between the viewpoint coordinate system and the voxel coordinate system is the same, the coordinate conversion parameters are also considered to be the same. That is, in the starting point coordinate search unit 123 and the ray casting processing unit 124, the coordinate conversion parameters for performing coordinate conversion on the voxel coordinate system are the same for all voxels referred to in the viewpoint coordinate system. Therefore, the coordinate conversion unit 122 calculates the coordinate conversion parameter in advance in step S220, and uses the coordinate conversion parameter as a common coordinate conversion parameter in subsequent steps. Examples of coordinate conversion parameters include the following.

・X軸周りの回転角をRx(単位:ラジアン)としたとき、sin(Rx)とcos(Rx)をあらかじめ座標変換パラメータとして算出する。YZ軸についても同様にあらかじめ算出する。
・X軸方向のオフセットXoff(単位:ボクセル)をあらかじめ座標変換パラメータとして保持しておく。YZ軸についても同様にあらかじめ保持しておく。
・XYZ軸方向のROI(Region Of Interest)をあらかじめ座標変換パラメータとして保持しておく。ROIはXYZ軸各方向における表示範囲を指示し、指定された範囲外のボクセルがボリュームレンダリング画像において非表示になるように、範囲外のボクセルの不透明度を全て0に設定する作用をもつ。
・拡大縮小倍率Scaleをあらかじめ座標変換パラメータとして保持しておく。XYZ各軸について同じ値を用いてもよいし、それぞれ異なる値を用いてもよい。
・Z方向変倍率:CTまたはMRIスキャンの過程において、スライス画像における2次元XY方向の画素間隔とスライス画像のZ方向(体軸方向)のスライス間隔が一般に異なるため、スライス画像の集合で構成される3次元のボクセル画像のXY方向の画像スケールとZ方向の画像スケールが異なってくる。そのため、画像をZ方向に変倍する必要がある。この場合はXY方向の解像度とZ方向の解像度の間の比率をあらかじめ算出しておき、これを座標変換時に上記拡大縮小倍率に併せて適用する。
When the rotation angle around the X axis is Rx (unit: radians), sin (Rx) and cos (Rx) are calculated in advance as coordinate conversion parameters. The YZ axis is similarly calculated in advance.
The offset Xoff (unit: voxel) in the X-axis direction is stored in advance as a coordinate conversion parameter. Similarly, the YZ axis is held in advance.
-The ROI (Region Of Interest) in the XYZ-axis directions is held in advance as a coordinate conversion parameter. The ROI indicates the display range in each direction of the XYZ axes, and has an effect of setting all opacity of voxels outside the range to 0 so that voxels outside the specified range are not displayed in the volume rendering image.
-The enlargement / reduction ratio Scale is stored in advance as a coordinate conversion parameter. The same value may be used for each axis of XYZ, or different values may be used.
-Z-direction magnification: In the CT or MRI scan process, the two-dimensional XY-direction pixel interval in the slice image and the slice interval in the Z-direction (body axis direction) of the slice image are generally different. The image scale in the XY direction and the image scale in the Z direction of the three-dimensional voxel image differ. Therefore, it is necessary to scale the image in the Z direction. In this case, a ratio between the resolution in the XY direction and the resolution in the Z direction is calculated in advance, and this is applied together with the enlargement / reduction ratio at the time of coordinate conversion.

レイキャスティング処理とは、仮想光を視点からボクセルに対して照射したと仮定して、最深点(仮想光の光強度が所定の値以下に減衰した点)を探索し、最深点から光軌跡を遡って投影面における輝度値を積算することにより、投影面上における画素値を算出する方法が基本である。レイキャスティング処理部124では、最深点を探索する過程で、通過した全てのボクセルの不透明度を基に仮想光の光強度を積算しながら、通過した全てのボクセルの色値と不透明度を基に投影面における輝度値を積算する処理を同時に行う。通過した全てのボクセルの色値と不透明度は、視点座標系から座標変換によりボクセル座標系における対応するボクセルの色値と不透明度にしたがって算出することになるので、ボクセル座標系における8近傍のボクセルの色値と不透明度を補間する必要がある。   The ray casting process assumes that the voxel is irradiated with virtual light from the viewpoint, searches for the deepest point (the point where the light intensity of the virtual light is attenuated below a predetermined value), and determines the light locus from the deepest point. The basic method is to calculate the pixel value on the projection plane by retroactively integrating the luminance values on the projection plane. In the process of searching for the deepest point, the ray casting processing unit 124 accumulates the light intensity of the virtual light based on the opacity of all the passed voxels, and based on the color value and opacity of all the passed voxels. The process of integrating the luminance values on the projection surface is performed simultaneously. Since the color values and opacity of all the passed voxels are calculated according to the color values and opacity of the corresponding voxels in the voxel coordinate system by coordinate conversion from the viewpoint coordinate system, there are 8 neighboring voxels in the voxel coordinate system. It is necessary to interpolate the color value and opacity of.

図4は、ステップS230において起点座標探索部123が探索制御テーブルを作成する手順を説明する図である。起点座標探索部123は、ボリュームレンダリング画像の画素(x,y)ごとに起点座標を記述した探索制御テーブルを作成する。起点座標とは、視点座標系において、視点(z=0)からボクセルをz軸方向(z>0)に探索して最初に見つかった不透明度が0でない値をもつボクセルの視点座標系におけるz座標値(正また0の値)である。探索した結果、不透明度が0でない値をもつボクセルが見つからなかった場合、即ちz方向の末端まで全てのボクセルが透明な場合、起点座標として負値(−1)を設定する。ボリュームレンダリング画像の全ての画素の座標(x,y)について、始めに仮想光を投射する起点座標を探索する必要があるが、この探索処理は座標(x,y)ごとに視点座標系のz軸方向の複数のボクセルの不透明度を参照する必要があり、各ボクセルの不透明度を取得するために座標変換処理を実行して対応するボクセル座標系の複数のボクセルの不透明度の値を補間する処理を実行するため、演算負荷が比較的大きい。そこで、2次元の探索制御テーブルを作成する方法をとることにより、一部の座標に対する起点座標については、近傍の座標において探索された起点座標を流用し、探索処理を省略することができる。本実施形態1においては個々の画素に対して実行される起点座標の探索処理の演算負荷を抑制するため、以下の手順により探索制御テーブルを作成する。   FIG. 4 is a diagram illustrating a procedure in which the origin coordinate search unit 123 creates a search control table in step S230. The starting point coordinate search unit 123 creates a search control table in which starting point coordinates are described for each pixel (x, y) of the volume rendering image. The origin coordinate is z in the viewpoint coordinate system of a voxel having a non-zero opacity value that is first found by searching a voxel from the viewpoint (z = 0) in the z-axis direction (z> 0) in the viewpoint coordinate system. It is a coordinate value (positive or zero value). As a result of the search, if no voxel having a non-zero opacity value is found, that is, if all voxels are transparent up to the end in the z direction, a negative value (−1) is set as the starting point coordinate. For the coordinates (x, y) of all the pixels of the volume rendering image, it is necessary to first search for the starting point coordinates for projecting the virtual light. This search process is performed for each coordinate (x, y) in the viewpoint coordinate system z. Need to refer to the opacity of multiple voxels in the axial direction, perform coordinate transformation to get the opacity of each voxel and interpolate the opacity values of multiple voxels in the corresponding voxel coordinate system Since the process is executed, the calculation load is relatively large. Therefore, by using a method of creating a two-dimensional search control table, for the start point coordinates for some coordinates, the start point coordinates searched for in the nearby coordinates can be used, and the search process can be omitted. In the first embodiment, a search control table is created according to the following procedure in order to suppress the calculation load of the search processing for the starting point coordinates executed for each pixel.

起点座標探索部123は、まずボリュームレンダリング画像のx軸方向およびy軸方向の偶数番目の画素(2m,2n)(m=0,1,・・・、n=0,1,・・・)について、起点座標を探索する。図4左図の塗り潰した部分がこれに相当する。ボリュームレンダリング画像の画素数は一般に512×512など偶数個に設定される場合が多く、後述する補間処理では画像末端部の奇数番目の画素の起点座標を設定できないため、図4左図のように、x軸方向の右末端の画素およびy軸方向の下端の画素についても起点座標を探索する。   The starting point coordinate search unit 123 first sets even-numbered pixels (2m, 2n) in the x-axis direction and the y-axis direction of the volume rendering image (m = 0, 1,..., N = 0, 1,...). Search for the origin coordinates. The shaded portion in the left figure of FIG. 4 corresponds to this. In general, the number of pixels of the volume rendering image is often set to an even number such as 512 × 512, and the starting point coordinates of the odd-numbered pixels at the end of the image cannot be set by the interpolation processing described later. The origin coordinates are also searched for the rightmost pixel in the x-axis direction and the lowermost pixel in the y-axis direction.

起点座標探索部123は、ボリュームレンダリング画像のy軸方向の偶数番目の画素の中で、x方向の奇数番目の画素(2m+1,2n)について、先に探索されたx方向における両隣の偶数番目の画素の起点座標が同じであるか否かをチェックする。例えば画素(1,0)については、両隣である画素(0,0)の起点座標と画素(2,0)の起点座標が同じであるか否かをチェックする。ただし、x方向の右末端の画素は奇数番目であっても、図4左図の通り既に起点座標が設定されているので、本チェック処理の対象外とする。両隣の起点座標が同じである場合、対象物は当該画素近傍において同様の形状を有していると推定されるので、間に挟まれている画素の起点座標も両隣の起点座標と同じであるとみなすことができる。また、両隣の起点座標が負値となる背景部の画素である場合、間に挟まれている画素も背景部であるとみなすことができる。そこで起点座標探索部123は、画素(2m+1,2n)の両隣の起点座標が同じである場合、画素(2m+1,2n)についても同じ起点座標を設定する。図4中央図の縦ハッチング部分がこれに相当する。一方、両隣の起点座標が異なる場合、両隣の偶数番目の画素と同様に、起点座標探索部123は、起点座標を探索する処理を実行し、探索した起点座標を設定する。   The starting point coordinate search unit 123 for the odd-numbered pixels (2m + 1, 2n) in the x-direction among the even-numbered pixels in the y-axis direction of the volume rendering image, Check whether the origin coordinates of the pixels are the same. For example, for pixel (1, 0), it is checked whether the starting point coordinates of pixel (0, 0) that is adjacent to each other are the same as the starting point coordinates of pixel (2, 0). However, even if the pixel at the right end in the x direction is an odd-numbered pixel, the starting point coordinates are already set as shown in the left diagram of FIG. If the starting point coordinates on both sides are the same, the object is presumed to have the same shape in the vicinity of the pixel, so the starting point coordinates of the pixels sandwiched between them are the same as the starting point coordinates on both sides. Can be considered. In addition, in the case where the pixels of the background portion where the starting point coordinates on both sides are negative values, the pixels sandwiched between them can also be regarded as the background portion. Therefore, the starting point coordinate search unit 123 sets the same starting point coordinates for the pixel (2m + 1, 2n) when the starting point coordinates on both sides of the pixel (2m + 1, 2n) are the same. This corresponds to the vertical hatched portion in the center of FIG. On the other hand, when the start point coordinates on both sides are different, the start point coordinate search unit 123 executes a process of searching for the start point coordinates and sets the searched start point coordinates, as with the even-numbered pixels on both sides.

起点座標探索部123は、ボリュームレンダリング画像のy方向が奇数番目でx方向は全ての画素(x,2n+1)について、y方向における両隣の偶数番目の画素の起点座標が同じであるか否かをチェックする。例えば画素(0,1)については、両隣である画素(0,0)の起点座標と画素(0,2)の起点座標が同じであるか否かチェックする。ただし、y方向の下末端行の画素は奇数番目であっても、図4中央図の通り既に起点座標が設定されているので、本チェック処理の対象外とする。両隣の起点座標が同じである場合は、x方向と同様に、間に挟まれている画素についても同じ起点座標を設定する。そして、両隣の起点座標が異なる場合は、x方向と同様に、起点座標探索部123は、起点座標を探索する処理を実行し、探索した起点座標を設定する。図4右図の横ハッチング部分がこれに相当する。   The starting point coordinate search unit 123 determines whether or not the starting point coordinates of the even-numbered pixels on both sides in the y direction are the same for all pixels (x, 2n + 1) in the y direction in the y direction of the volume rendering image and in the x direction. To check. For example, for pixel (0, 1), it is checked whether the starting point coordinates of pixel (0, 0) that are adjacent to each other are the same as the starting point coordinates of pixel (0, 2). However, even if the number of pixels in the lower end row in the y direction is an odd number, the starting point coordinates are already set as shown in the center diagram of FIG. When the starting point coordinates on both sides are the same, the same starting point coordinates are set for pixels sandwiched between them as in the x direction. When the starting point coordinates on both sides are different, the starting point coordinate searching unit 123 executes a process of searching for the starting point coordinates and sets the searched starting point coordinates, similarly to the x direction. The horizontal hatched portion in the right side of FIG. 4 corresponds to this.

図4では縦横1画素置きに起点座標の探索を行い、間に挟まれている1画素を両隣の画素を基に補間する方法を示したが、これは一例に過ぎず、縦横M(M>1)画素置きに起点座標の探索を行い、間に挟まれているM個の各画素を両隣の画素を基に補間する方法もとることもでき、その場合は演算負荷を更に抑制することができる。   FIG. 4 shows a method of searching for the origin coordinates every other vertical and horizontal pixels and interpolating one pixel sandwiched between them based on both adjacent pixels, but this is only an example, and vertical and horizontal M (M> 1) It is also possible to use a method in which the origin coordinates are searched every other pixel and the M pixels sandwiched between them are interpolated based on the adjacent pixels. In this case, the calculation load is further suppressed. it can.

図5は、ステップS230において起点座標探索部123が各画素において起点座標を探索する手順を説明する図である。図4においては、xy方向の隣接画素において探索された起点座標を基に一部の起点探索の処理を省略することにより起点座標の設定を高速化する手順を説明した。これに代えてまたは併用して、z方向の起点探索の処理自体を高速化することにより、起点探索の演算負荷を二重に抑制することができる。   FIG. 5 is a diagram illustrating a procedure in which the starting point coordinate search unit 123 searches for starting point coordinates in each pixel in step S230. In FIG. 4, the procedure for speeding up the setting of the start point coordinates by omitting a part of the start point search process based on the start point coordinates searched in the adjacent pixels in the xy direction has been described. Instead of this or in combination, the calculation process of the starting point search in the z direction can be speeded up, so that the calculation load of the starting point search can be doubled.

起点座標探索部123は、視点から開始して視線座標系のz方向に沿って各ボクセルの不透明度を参照する。始めに、視点位置(z=0)におけるボクセルの不透明度を確認し、不透明度が0でない場合は被写体の表面(切断面)であるため、起点座標はz=0で探索打ち切りとなり、演算負荷が小さい。しかし、視点位置(z=0)におけるボクセルの不透明度が0である場合(背景部に多い)、z方向に透明なボクセルが連続して存在する可能性が高く、背景部ではz方向の末端部まで全てのボクセルの不透明度が0となり、隣接するボクセルを順次参照する方法をとると、起点座標が負値であることを決定するためにz方向の末端部まで全てのボクセルに対して座標変換を行いながらボクセルの不透明度を参照する必要があり、膨大な演算負荷を伴ってしまう。そこで、視点位置(z=0)におけるボクセルの不透明度が0である場合は、隣接するボクセルを順次参照するのではなく、任意個数のボクセルをスキップしながら不透明度を参照する(図5左図)。例えばz方向に8ボクセルごとに不透明度を参照する。z方向の終端のボクセルに至っても不透明度が0ではないボクセルが見つからなかった場合は、起点座標として負値を設定して探索打ち切りとする。一方、不透明度が0ではない(完全透明ではない)最初のボクセルが見つかった場合は、起点座標を正確に決定するため図5右図の工程に移る。   The starting point coordinate search unit 123 refers to the opacity of each voxel starting from the viewpoint and along the z direction of the line-of-sight coordinate system. First, the opacity of the voxel at the viewpoint position (z = 0) is confirmed. If the opacity is not 0, the object is the surface (cut surface) of the subject. Is small. However, when the opacity of the voxel at the viewpoint position (z = 0) is 0 (mostly in the background portion), there is a high possibility that transparent voxels continuously exist in the z direction, and the background portion has an end in the z direction. If the opacity of all voxels until the part becomes 0 and the method of referring to the adjacent voxels sequentially is taken, the coordinates for all the voxels up to the end part in the z direction are determined in order to determine that the starting point coordinate is a negative value. It is necessary to refer to the opacity of the voxel while performing the conversion, which entails a huge calculation load. Therefore, when the opacity of the voxel at the viewpoint position (z = 0) is 0, the opacity is referred to while skipping an arbitrary number of voxels instead of sequentially referring to the adjacent voxels (the left figure in FIG. 5). ). For example, opacity is referenced every 8 voxels in the z direction. If a voxel whose opacity is not 0 is not found even when reaching the terminal voxel in the z direction, a negative value is set as the starting point coordinate and the search is terminated. On the other hand, when the first voxel whose opacity is not 0 (not completely transparent) is found, the process proceeds to the process on the right side of FIG. 5 in order to accurately determine the starting point coordinates.

起点座標探索部123は、最初に見つかった不透明ボクセルから視点に向かって遡り、不透明度が0である最初のボクセルを探索する(図5右図)。このときは視点座標系のz方向に隣接するボクセルの不透明度を1ボクセルごとにスキップ幅を上限として順次参照する。不透明度が0である最初のボクセル(図5右図の白いボクセル)が見つかった時点で、その1つ前のボクセル(視点から遠ざかる方向)の視点座標系におけるz座標を起点座標として、探索制御テーブルに格納する。スキップ幅の上限まで遡って、不透明度が0である最初のボクセルが見つからなかった場合は、最初に見つかった不透明ボクセルの視点座標系におけるz座標を起点座標として、探索制御テーブルに格納する。以上の手順により、z方向の起点探索を高速化することができる。   The origin coordinate search unit 123 searches for the first voxel with an opacity of 0, going back from the first found opaque voxel toward the viewpoint (right diagram in FIG. 5). At this time, the opacity of the voxels adjacent in the z direction of the viewpoint coordinate system is sequentially referenced for each voxel with the skip width as the upper limit. When the first voxel with an opacity of 0 (white voxel in the right figure in FIG. 5) is found, search control is performed using the z coordinate in the viewpoint coordinate system of the previous voxel (direction away from the viewpoint) as the origin coordinate. Store in a table. Going back to the upper limit of the skip width, if the first voxel with an opacity of 0 is not found, the z coordinate in the viewpoint coordinate system of the first found opaque voxel is stored as a starting point coordinate in the search control table. With the above procedure, the search for the starting point in the z direction can be speeded up.

図4と図5に示す手順において、起点座標探索部123は、視点座標系(x,y,z)を基準としてz方向に配置されたボクセルの不透明度を参照することになる。しかし実際に参照するのはボクセル座標系におけるボクセルが有する不透明度であるので、実際のボクセルが有する不透明度を取得するためには、視点座標系からボクセル座標系への座標変換が必要になる。座標変換のためのパラメータは、ステップS220においてあらかじめ算出しておけばよい。座標変換により算出したボクセル座標系の座標値(x’,y’,z’)は実数値になるが、ボクセル座標系におけるボクセルを参照するためには整数値に変換する必要がある。この時、小数点以下を切り捨てて整数化してボクセル座標系における単一のボクセルを参照する方法をとると、ボリュームレンダリング画像にモアレが発生することが知られているため、算出されたボクセル座標系の実数座標値(x’,y’,z’)に隣接する8近傍の整数座標値のボクセルの不透明度に対して実数座標値の小数点以下の数値に応じて重み付けした値を合算することにより、不透明度を算出する方法が望ましい。後述するレイキャスティング処理においても同様であるが、レイキャスティング処理においてはボクセルの不透明度だけでなくRGB3値からなる色値も参照する必要があるため、起点座標の探索における座標変換の処理負荷はレイキャスティング処理における座標変換の処理負荷に比べ1/4に抑制できる。   In the procedure shown in FIGS. 4 and 5, the starting point coordinate search unit 123 refers to the opacity of the voxels arranged in the z direction with the viewpoint coordinate system (x, y, z) as a reference. However, since what is actually referred to is the opacity of the voxel in the voxel coordinate system, coordinate conversion from the viewpoint coordinate system to the voxel coordinate system is necessary to obtain the opacity of the actual voxel. Parameters for coordinate conversion may be calculated in advance in step S220. The coordinate values (x ′, y ′, z ′) of the voxel coordinate system calculated by the coordinate conversion are real values, but in order to refer to the voxels in the voxel coordinate system, it is necessary to convert them to integer values. At this time, it is known that if the method of referring to a single voxel in the voxel coordinate system by rounding off the decimal point is used as an integer, moire is generated in the volume rendering image, so the calculated voxel coordinate system By adding the weighted values according to the numerical value after the decimal point of the real coordinate value to the opacity of the voxel of the integer coordinate value near 8 adjacent to the real coordinate value (x ′, y ′, z ′), A method of calculating opacity is desirable. The same applies to the ray casting process described later. However, in the ray casting process, it is necessary to refer not only to the voxel opacity but also to the color value composed of RGB three values. Compared to the processing load of coordinate conversion in the casting process, it can be suppressed to ¼.

図6は、起点座標探索部123が各画素において起点座標を探索する手順を説明するフローチャートである。起点座標探索部123は、各対象画素(x,y)について本フローチャートを実施する。以下図6の各ステップについて説明する。   FIG. 6 is a flowchart for explaining the procedure by which the origin coordinate search unit 123 searches for the origin coordinates in each pixel. The starting point coordinate search unit 123 executes this flowchart for each target pixel (x, y). Hereinafter, each step of FIG. 6 will be described.

(図6:ステップS601)
起点座標探索部123は、起点座標を探索する対象画素(x,y)、3次元座標(x,y,z)をセットする。z座標の初期値はz=Zsとする。Zsは視点のz座標である。尚、図5の説明においては、視点座標系におけるz座標の初期値はz=0とし、z座標の値を増大させる正方向に探索する方法で説明したが、図6ではソフトウェアの実装形態に基づき、視点座標系におけるz座標の初期値はz=Zs(>0)とし、z座標の値を減少させる負方向に探索する方法で説明する。
(FIG. 6: Step S601)
The starting point coordinate search unit 123 sets the target pixel (x, y) and three-dimensional coordinates (x, y, z) for searching the starting point coordinate. The initial value of the z coordinate is z = Zs. Zs is the z coordinate of the viewpoint. In the description of FIG. 5, the initial value of the z coordinate in the viewpoint coordinate system is set to z = 0, and the method of searching in the positive direction for increasing the value of the z coordinate has been described. However, in FIG. Based on this, the initial value of the z coordinate in the viewpoint coordinate system is set to z = Zs (> 0), and a method of searching in the negative direction for decreasing the value of the z coordinate will be described.

(図6:ステップS602)
起点座標探索部123は、3次元座標(x,y,z)について、座標変換を実施して視点座標系に座標変換する前のボクセルに対応する不透明度αを算出する。算出手順としては、例えば上述のように隣接するボクセルの不透明度を重み付け加算する手法を用いることができる。αが0であればステップS603へ進み、αが0でなければステップS605へ進む。
(FIG. 6: Step S602)
The starting point coordinate search unit 123 calculates the opacity α corresponding to the voxel before the coordinate conversion is performed on the three-dimensional coordinates (x, y, z) and the coordinate conversion is performed on the viewpoint coordinate system. As the calculation procedure, for example, a method of weighting and adding the opacity of adjacent voxels as described above can be used. If α is 0, the process proceeds to step S603, and if α is not 0, the process proceeds to step S605.

(図6:ステップS603)
起点座標探索部123は、z軸方向に所定個数のボクセルをスキップする。具体的には現在のz座標からm(例えばm=8)減算する。減算した結果、z座標が0未満になった場合は、ステップS604へ進む。z座標が0以上である場合はステップS602へ戻って同様の処理を繰り返す。
(FIG. 6: Step S603)
The starting point coordinate search unit 123 skips a predetermined number of voxels in the z-axis direction. Specifically, m (for example, m = 8) is subtracted from the current z coordinate. If the z coordinate is less than 0 as a result of the subtraction, the process proceeds to step S604. If the z coordinate is greater than or equal to 0, the process returns to step S602 and the same processing is repeated.

(図6:ステップS604)
起点座標探索部123は、現在の対象画素(x,y)に対応する探索制御テーブルの値M(x,y)に対して、起点座標が見つからなかった旨を示す値(例えば−1などの負値)をセットして本フローチャートを終了する。
(FIG. 6: Step S604)
The starting point coordinate search unit 123 has a value (for example, -1 or the like) indicating that the starting point coordinate is not found with respect to the value M (x, y) of the search control table corresponding to the current target pixel (x, y). (Negative value) is set, and this flowchart is terminated.

(図6:ステップS605〜S606)
起点座標探索部123は、変数iを初期化した後(S605)、1ずつインクリメントする(S606)。iがmまで到達した場合、または現在のz座標にiを加算すると視点z座標に達する場合は、ステップS608までスキップする。iがmまで到達しておらず、かつ現在のz座標にiを加算しても視点z座標まで達しない場合は、ステップS607へ進む。
(FIG. 6: Steps S605 to S606)
The starting point coordinate search unit 123 initializes the variable i (S605), and increments it by 1 (S606). When i reaches m, or when i is added to the current z coordinate and the viewpoint z coordinate is reached, the process skips to step S608. If i has not reached m and the viewpoint z coordinate is not reached even if i is added to the current z coordinate, the process proceeds to step S607.

(図6:ステップS607)
起点座標探索部123は、3次元座標(x,y,z+i)について、座標変換を実施して視点座標系に座標変換する前のボクセルに対応する不透明度αを算出する。算出手順はステップS602と同じである。αが0であればステップS608へ進み、αが0でなければステップS606へ戻ってiをインクリメントして同様の処理を繰り返す。
(FIG. 6: Step S607)
The starting point coordinate search unit 123 calculates the opacity α corresponding to the voxel before the coordinate conversion is performed on the three-dimensional coordinates (x, y, z + i) and the coordinate conversion to the viewpoint coordinate system is performed. The calculation procedure is the same as in step S602. If α is 0, the process proceeds to step S608. If α is not 0, the process returns to step S606, i is incremented, and the same processing is repeated.

(図6:ステップS608)
起点座標探索部123は、現在の対象画素(x,y)に対応する探索制御テーブルの値M(x,y)に対して、ステップS607の1つ手前のz座標(z+i−1)をセットして本フローチャートを終了する。
(FIG. 6: Step S608)
The starting point coordinate search unit 123 sets the z coordinate (z + i−1) immediately before step S607 to the value M (x, y) in the search control table corresponding to the current target pixel (x, y). And this flowchart is complete | finished.

図7は、ステップS240においてレイキャスティング処理部124がレイキャスティング処理を実施する手順を説明する図である。レイキャスティング処理部124は、求まるボリュームレンダリング画像の各画素の(x,y)座標に対して探索制御テーブルが保持している起点座標を参照して、(x,y,z)視点座標系において起点座標よりz方向に仮想光を投射し、仮想光が通過する各ボクセルに対して(x’,y’,z’)ボクセル座標系における対応するボクセルの色値と不透明度を用いて仮想光の光強度および当該画素の輝度(RGB値)をz方向のボクセルごとに積算し、仮想光の光強度が所定の値以下に減衰するか、z方向の終端のボクセルに至る段階まで積算する処理を継続し、最終的に積算された当該画素の輝度(RGB値)をボリュームレンダリング画像の当該画素(x,y)の画素値として与える。   FIG. 7 is a diagram illustrating a procedure in which the ray casting processing unit 124 performs the ray casting process in step S240. The ray casting processing unit 124 refers to the origin coordinates held in the search control table with respect to the (x, y) coordinates of each pixel of the obtained volume rendering image, and in the (x, y, z) viewpoint coordinate system. Virtual light is projected in the z direction from the origin coordinates, and for each voxel through which the virtual light passes, virtual light is used using the color value and opacity of the corresponding voxel in the (x ′, y ′, z ′) voxel coordinate system. And the luminance (RGB value) of the pixel is integrated for each voxel in the z direction, and the light intensity of the virtual light is attenuated to a predetermined value or less, or is integrated up to the stage reaching the terminal voxel in the z direction. The luminance (RGB value) of the pixel finally integrated is given as the pixel value of the pixel (x, y) of the volume rendering image.

レイキャスティング処理の途上で、あるz座標におけるボクセルの不透明度が0である(すなわち透明である)場合がある。透明ボクセルに対しては仮想光の光強度および画素の輝度(RGB値)の積算処理は行われないため、透明ボクセルはスキップし、次の不透明ボクセルを探索する。このときレイキャスティング処理部124は、視点座標系のz方向において視点からずれたz>0である途中の透明ボクセルから探索を開始して図5と同様の手法により、不透明度が0でない最初のボクセルを探索することができる(図7左図〜図7右図)。レイキャスティング処理においてはボクセルの不透明度だけでなくRGB3値からなる色値も必要になるが、不透明ボクセルを探索する際は、ボクセルの色値は不要なため、座標変換において不透明度だけを算出すればよく、座標変換の演算負荷を1/4に抑制できる。不透明度が0でないボクセルが見つかると、そのボクセルからレイキャスティング処理を再開し、仮想光の光強度が所定の値以下に減衰するか、z方向の終端のボクセルに至るまでレイキャスティング処理を継続する。図7<まとめ>は、以上の手順によりレイキャスティング処理を実施する不透明なボクセルとスキップする透明なボクセルを区分した結果をまとめたものである。レイキャスティング処理の途中に存在する透明なボクセルに対して座標変換を伴いながら色値および不透明度を参照する処理をスキップすることにより、レイキャスティング処理を高速化することができる。   In the course of the ray casting process, the opacity of the voxel at a certain z coordinate may be zero (that is, transparent). The transparent voxel is skipped and the next opaque voxel is searched because the integration process of the light intensity of the virtual light and the luminance (RGB value) of the pixel is not performed on the transparent voxel. At this time, the ray casting processing unit 124 starts searching from a transparent voxel in the middle where z> 0 deviated from the viewpoint in the z direction of the viewpoint coordinate system, and uses the same method as in FIG. A voxel can be searched (FIG. 7 left figure-FIG. 7 right figure). In the ray casting process, not only the opacity of the voxel but also a color value composed of RGB three values is necessary. However, when searching for an opaque voxel, the color value of the voxel is unnecessary, so only the opacity is calculated in the coordinate conversion. What is necessary is just to suppress the calculation load of coordinate transformation to 1/4. When a voxel with an opacity of 0 is found, the ray casting process is restarted from that voxel, and the ray casting process is continued until the light intensity of the virtual light is attenuated below a predetermined value or reaches the terminal voxel in the z direction. . FIG. 7 <Summary> is a summary of the results obtained by classifying the opaque voxels to be subjected to the ray casting process and the transparent voxels to be skipped by the above procedure. By skipping the process of referring to color values and opacity while performing coordinate conversion for transparent voxels existing in the middle of the ray casting process, the speed of the ray casting process can be increased.

レイキャスティング処理部124が色値や不透明度を参照する際には、視点座標系(x,y,z)を基準として対応するボクセル座標系におけるボクセルのこれら値を参照することになる。したがって視点座標系からボクセル座標系への座標変換が必要になる。座標変換パラメータについては起点座標探索部123が用いるものと同様である。ただし、レイキャスティング処理においてはボクセルの不透明度だけでなくRGB3値からなる色値も必要になる。そのため、座標変換されたボクセル座標系の実数座標値(x’,y’,z’)に隣接する8近傍の整数座標値に対応するボクセルの色値と不透明度に対して実数座標値の小数点以下の数値に応じて重み付けした値を合算することにより、ボクセルの色値と不透明度を取得する方法をとる。   When the ray casting processing unit 124 refers to the color value or opacity, the value of the voxel in the corresponding voxel coordinate system is referred to based on the viewpoint coordinate system (x, y, z). Therefore, coordinate conversion from the viewpoint coordinate system to the voxel coordinate system is required. The coordinate conversion parameters are the same as those used by the origin coordinate search unit 123. However, in the ray casting process, not only the opacity of the voxel but also a color value composed of RGB three values is required. Therefore, the decimal point of the real coordinate value with respect to the color value and opacity of the voxel corresponding to the integer coordinate value in the vicinity of 8 adjacent to the real coordinate value (x ′, y ′, z ′) of the coordinate-converted voxel coordinate system. A method of obtaining the color value and opacity of the voxel by adding the weighted values according to the following numerical values.

<実施の形態1:まとめ>
本実施形態1に係るレイキャスティング装置100は、起点座標探索とレイキャスティング処理において用いる座標変換の座標変換パラメータをあらかじめ算出しておき、これを用いて起点座標探索とレイキャスティング処理の各々において参照が必要な最小限のボクセルに限定して座標変換を実施する。これにより、あらかじめボクセル座標系から視点座標系に変換された全てのボクセルデータ構造体を作成した上で、起点座標探索とレイキャスティング処理を行う公知の方法に比べ、3次元のボクセルデータ構造体を保持するメモリが不要になるとともに、座標変換の回数を削減することができ、メモリアクセス負荷および演算負荷を抑制することができる。例えば、512×512画素のスライス画像が256枚で構成されるボクセル画像を視点座標系に変換すると、Z方向変倍率を2.0として、x:512×y:512×z:512ボクセルの視点座標系に変換されたボクセルデータ構造体を作成する必要があり、512の3乗回の座標変換が必要になる。これに対して、起点座標探索を行う際は、不透明度が0でないボクセルが即座に見つかれば、z方向に後続するボクセルに対しては参照する必要が無く、座標変換を省略することができる。また、レイキャスティング処理を行う際は、仮想光の光強度が所定の値以下に減衰すれば積算処理を打ち切ることができ、z方向に後続するボクセルに対しては参照する必要が無く、座標変換を省略することができる。これらの省略により、座標変換の回数を約1/3程度削減することができる。したがって、パーソナルコンピュータなどの一般的コンピュータであっても、実用的な時間内でレイキャスティング法を用いてボリュームレンダリング画像を生成することができる程度に、演算負荷を抑制することができる。
<Embodiment 1: Summary>
The ray casting apparatus 100 according to the first embodiment calculates the coordinate conversion parameters for the coordinate conversion used in the starting point coordinate search and the ray casting process in advance, and uses them for reference in each of the starting point coordinate search and the ray casting process. Coordinate transformation is limited to the minimum required voxels. As a result, all the voxel data structures converted from the voxel coordinate system to the viewpoint coordinate system in advance are created, and the three-dimensional voxel data structure is compared with the known method for performing the origin coordinate search and the ray casting process. A memory to be held becomes unnecessary, the number of coordinate transformations can be reduced, and a memory access load and a calculation load can be suppressed. For example, when a voxel image composed of 256 slice images of 512 × 512 pixels is converted to the viewpoint coordinate system, the viewpoint of x: 512 × y: 512 × z: 512 voxels is set to a Z-direction scaling factor of 2.0. It is necessary to create a voxel data structure converted into the coordinate system, and 512 cubed coordinate conversion is required. On the other hand, when a starting point coordinate search is performed, if a voxel with an opacity of 0 is found immediately, there is no need to refer to a voxel that follows in the z direction, and coordinate conversion can be omitted. In addition, when performing ray casting processing, if the light intensity of the virtual light is attenuated to a predetermined value or less, the integration processing can be terminated, and there is no need to refer to the voxel following in the z direction, and coordinate conversion is performed. Can be omitted. By omitting these, the number of coordinate transformations can be reduced by about 1/3. Therefore, even a general computer such as a personal computer can suppress the calculation load to such an extent that a volume rendering image can be generated using a ray casting method within a practical time.

本実施形態1に係るレイキャスティング装置100は、ボリュームレンダリング画像の一部の画素に対してレイキャスティング処理を開始する起点座標をあらかじめ探索し、その結果を探索制御テーブルとして保存しておく。そして、ボリュームレンダリング画像の残りの画素に対しては、探索制御テーブルに記録されている起点座標を基に補間する方法をとる。これにより、ボリュームレンダリング画像の全ての画素に対応して起点座標を探索する必要がなくなるので、起点座標を探索して座標変換を実行する回数を削減し演算負荷を抑制することができる。   The ray casting apparatus 100 according to the first embodiment searches in advance for start point coordinates for starting the ray casting process for a part of the pixels of the volume rendering image, and stores the result as a search control table. Then, the remaining pixels of the volume rendering image are interpolated based on the starting point coordinates recorded in the search control table. This eliminates the need to search for the starting point coordinates corresponding to all the pixels of the volume rendering image, thereby reducing the number of times of searching for the starting point coordinates and executing coordinate transformation, and suppressing the calculation load.

本実施形態1に係るレイキャスティング装置100は、探索制御テーブルを作成する際に、同じ起点座標を有する2つの画素に挟まれた中間画素については、両隣の画素の起点座標をそのまま用いる。これにより、起点座標を探索するための演算負荷を抑制することができる。   When creating the search control table, the ray casting apparatus 100 according to the first embodiment uses the starting point coordinates of the adjacent pixels as they are for an intermediate pixel sandwiched between two pixels having the same starting point coordinate. Thereby, the calculation load for searching for a starting point coordinate can be suppressed.

本実施形態1に係るレイキャスティング装置100は、探索制御テーブルを作成する際に、z方向に沿ってスキップしながら不透明度が0でない最初のボクセルを探索し、これが見つかった時点でz方向に反対向きに遡って不透明度が0である最初のボクセルを探索する。これにより、対象物の背景に存在する不透明度が0となる透明ボクセルの分布および対象物の内部の不透明度が0でない不透明ボクセルの分布がある程度連続的であることを前提として、起点座標を効率的に探索することができる。   When creating the search control table, the ray casting apparatus 100 according to the first embodiment searches for the first voxel with non-opacity of 0 while skipping along the z direction, and when this is found, it opposes the z direction. Go back in direction and search for the first voxel with an opacity of zero. As a result, the coordinates of the starting point are made efficient on the premise that the distribution of transparent voxels with an opacity of 0 in the background of the object and the distribution of opaque voxels with an opacity of the object within the object of 0 are continuous to some extent. Can be searched.

本実施形態1に係るレイキャスティング装置100は、レイキャスティング処理を実施する過程において不透明度が0であるボクセルに到達すると、z方向に沿ってスキップしながら不透明度が0でない最初のボクセルを探索し、これが見つかった時点でz方向に反対向きに遡って不透明度が0である最初のボクセルを探索する。これにより、起点座標を探索する処理と同様に、レイキャスティング処理の対象とすべきボクセルを効率的に探索することができる。   When the ray casting apparatus 100 according to the first embodiment reaches a voxel having an opacity of 0 in the process of performing the ray casting process, the ray casting apparatus 100 searches for the first voxel having an opacity of 0 while skipping along the z direction. When this is found, the first voxel with an opacity of 0 going backward in the z direction is searched. Thereby, similarly to the process of searching for the starting point coordinates, it is possible to efficiently search for a voxel to be a target of the ray casting process.

<実施の形態2>
レイキャスティング処理において、ボリュームレンダリング画像の画質を向上させるため、具体的にはボリュームレンダリング画像中の被写体のエッジ部の段差・ジャギー(エイリアシングという)を除去する処理を行うため、座標変換を行う際、ボクセルの座標値を1ボクセル間の中間座標(サブサンプルという)だけ微小にオフセットを加えて(サブサンプリングという)、座標変換パラメータの算出S220、起点座標の探索S230およびレイキャスティング処理S240を各々複数回実施した上で、得られたボリュームレンダリング画像の画素値を平均化してスムージングする場合がある。これをアンチエイリアシングと呼ぶ。具体的には、座標変換パラメータの算出、起点座標の探索およびレイキャスティング処理を各々2回実行して平均化する場合、2回目の処理を実行する際、参照する視点座標系のボクセルの3次元座標値(x,y,z)の各値に0.5だけ加算して座標変換を行い、ボクセル座標系における不透明度または/かつ色値を取得する。そうすると、2回目の処理で得られるボリュームレンダリング画像における被写体の像が1回目の処理で得られボリュームレンダリング画像に比べ、最大1画素の範囲で位置ずれが生じ、これらを重ねて平均化することによりエッジ部における段差が解消される。実施形態1で説明した手法はサブサンプリングを実施する際にも用いることができる。本発明の実施形態2では、その具体例について説明する。レイキャスティング装置100の構成は実施形態1と同様である。
<Embodiment 2>
In the ray casting process, in order to improve the image quality of the volume rendering image, specifically, to remove the step / jaggy (called aliasing) at the edge of the subject in the volume rendering image, when performing coordinate conversion, The coordinate value of the voxel is slightly offset by an intermediate coordinate between one voxel (referred to as sub-sampling) (referred to as sub-sampling), and the coordinate conversion parameter calculation S220, the origin coordinate search S230, and the ray casting process S240 are performed a plurality of times. In some cases, smoothing may be performed by averaging the pixel values of the obtained volume rendering image. This is called anti-aliasing. Specifically, when the coordinate transformation parameter calculation, the origin coordinate search, and the ray casting process are each performed twice and averaged, the three-dimensional voxel of the viewpoint coordinate system to be referred to when the second process is performed Coordinate conversion is performed by adding 0.5 to each value of coordinate values (x, y, z), and opacity or / and color values in the voxel coordinate system are acquired. Then, the subject image in the volume rendering image obtained in the second processing is shifted in the range of a maximum of one pixel compared to the volume rendering image obtained in the first processing, and these are averaged by superimposing them. The level difference at the edge portion is eliminated. The method described in the first embodiment can also be used when performing sub-sampling. In the second embodiment of the present invention, a specific example will be described. The configuration of the ray casting apparatus 100 is the same as that of the first embodiment.

サブサンプリングを実施する場合は、中間座標だけオフセットを加えた上で座標変換を実施する必要がある。通常の整数座標を基準として、中間座標をどの方向に、どの程度の幅で付加するかについては、座標変換パラメータとしてあらかじめ定めておくことができる。例えばx軸、y軸、z軸の各々に沿って3つの中間座標を付加する場合、座標変換処理は(x,y,z)、(x+0.25,y+0.25,z+0.25)、(x+0.5,y+0.5,z+0.5)、(x+0.75,y+0.75,z+0.75)に対して実施することになる。この場合は座標変換パラメータとして、x軸方向、y軸方向、およびz軸方向のサブサンプルオフセットdx=dy=dz=0.25などと定めておけばよい。yz方向については、x方向と異なるサブサンプルオフセットを加えることもできる。ただし、中間座標の種類が多いと処理負荷の増大を招くだけで必ずしも画質改善につながらないため、中間座標としてdx=dy=dz=0.5のみとし、(x,y,z)と(x+0.5,y+0.5,z+0.5)の2通りで座標変換を行い、起点座標探索とレイキャスティング処理を各々2回実行して平均化する方法を用いてもよい。   When sub-sampling is performed, it is necessary to perform coordinate conversion after adding an offset by intermediate coordinates. With respect to normal integer coordinates, it is possible to determine in advance as a coordinate conversion parameter as to which direction and how wide the intermediate coordinates are added. For example, when three intermediate coordinates are added along each of the x-axis, y-axis, and z-axis, the coordinate conversion processing is (x, y, z), (x + 0.25, y + 0.25, z + 0.25), ( x + 0.5, y + 0.5, z + 0.5), (x + 0.75, y + 0.75, z + 0.75). In this case, the sub-sample offsets dx = dy = dz = 0.25 in the x-axis direction, the y-axis direction, and the z-axis direction may be determined as coordinate conversion parameters. For the yz direction, a subsample offset different from the x direction can be added. However, if there are many types of intermediate coordinates, the processing load is increased and the image quality is not necessarily improved. Therefore, the intermediate coordinates are only dx = dy = dz = 0.5, and (x, y, z) and (x + 0. 5, y + 0.5, z + 0.5), and coordinate conversion may be performed, and the starting point coordinate search and ray casting processing may be executed twice and averaged.

dx=dy=dz=0.25と定めた場合、x方向、y方向、z方向の各々にdx=dy=dz=0.25、0.5、0.75の3つの中間座標を加えてそれぞれ、座標変換パラメータの算出S220、起点座標の探索S230とレイキャスティング処理S240を実施することになるので、3つの中間座標それぞれに対応して同様に起点座標を求め探索制御テーブルを作成し直す必要がある。起点座標探索部123は、3つの中間座標それぞれに対応して起点座標を探索した結果を別の探索制御テーブルに記録する。この場合は4つの探索制御テーブルを作成することになる。yz座標についてx方向と異なる中間座標を加えてサブサンプリングを実施する場合は、これに対応して探索制御テーブルを増やして作成する。中間座標を加味して座標変換を行う場合でも図4と図5に示す手順を用いて効率的に起点座標を探索することができる。   When dx = dy = dz = 0.25, add three intermediate coordinates of dx = dy = dz = 0.25, 0.5, 0.75 to each of the x, y, and z directions. Since coordinate conversion parameter calculation S220, starting point coordinate search S230, and ray casting processing S240 are respectively performed, it is necessary to similarly determine the starting point coordinates for each of the three intermediate coordinates and recreate the search control table. There is. The starting point coordinate search unit 123 records the result of searching for the starting point coordinate corresponding to each of the three intermediate coordinates in another search control table. In this case, four search control tables are created. When subsampling is performed by adding intermediate coordinates different from the x direction for the yz coordinates, the search control table is increased correspondingly and created. Even when coordinate conversion is performed in consideration of intermediate coordinates, the starting point coordinates can be efficiently searched using the procedure shown in FIGS.

レイキャスティング処理部124は、ボリュームレンダリング画像の各画素に対して中間座標に対応した探索制御テーブルを参照して起点座標を取得し、中間座標に対しても同様にレイキャスティング処理を実施する。さらに中間座標においても図7と同様の手法によりレイキャスティング法を効率的に実施することができる。   The ray casting processing unit 124 refers to the search control table corresponding to the intermediate coordinates for each pixel of the volume rendering image, acquires the origin coordinates, and similarly performs the ray casting processing for the intermediate coordinates. Further, the ray casting method can be efficiently performed also at intermediate coordinates by the same method as in FIG.

本実施形態2に係るレイキャスティング装置100によれば、サブサンプリングによってボリュームレンダリング画像の画質を向上させる場合においても、起点座標探索やレイキャスティング処理を効率的に実施することができる。これにより、パーソナルコンピュータなどの一般的コンピュータであっても、実用的な時間内でサブサンプリングによりボリュームレンダリング画像の画質を向上させることができる。   According to the ray casting apparatus 100 according to the second embodiment, even when the image quality of a volume rendering image is improved by sub-sampling, the starting point coordinate search and the ray casting process can be performed efficiently. Thereby, even a general computer such as a personal computer can improve the image quality of the volume rendering image by sub-sampling within a practical time.

<実施の形態3>
ユーザがボリュームレンダリング画像を閲覧する際に、視点(座標変換パラメータにおけるX軸周り、Y軸周り、Z軸周りの回転角Rx、Ry,Rz)や倍率(座標変換パラメータにおける拡大縮小倍率Scale)を画面上で連続的に変更する場合がある。レイキャスティング装置100は、変更後の視点や倍率に対応するボリュームレンダリング画像を再描画する。このときユーザは、例えば画面上でマウスをドラッグすることにより視点のパラメータ(X軸周り、Y軸周り、Z軸周りの回転角Rx、Ry,Rz)を変更する。ユーザがマウスをドラッグしている間もボリュームレンダリング画像をリアルタイムに算出し更新し続けることができれば、ユーザにとっての操作感を向上させることができる。しかし、パーソナルコンピュータなどの一般的コンピュータで診断等に活用できるレベルの高精細なボリュームレンダリング画像をリアルタイムで生成するのは演算負荷が重く、ユーザのマウス操作に追従させてボリュームレンダリング画像を更新し続けることは困難である。そこで本発明の実施形態3では、ユーザがマウスドラッグにより視点を変更している間における演算負荷を抑制する手法を説明する。レイキャスティング装置100の構成は実施形態1と同様である。
<Embodiment 3>
When the user views the volume rendering image, the viewpoint (the rotation angles Rx, Ry, Rz around the X axis, the Y axis, and the Z axis in the coordinate conversion parameter) and the magnification (enlargement / reduction scale Scale in the coordinate conversion parameter) are displayed. It may change continuously on the screen. The ray casting apparatus 100 redraws the volume rendering image corresponding to the changed viewpoint and magnification. At this time, the user changes viewpoint parameters (rotation angles Rx, Ry, Rz about the X axis, the Y axis, and the Z axis) by dragging the mouse on the screen, for example. If the volume rendering image can be calculated and updated in real time while the user is dragging the mouse, the operational feeling for the user can be improved. However, generating a high-definition volume rendering image at a level that can be used for diagnosis or the like on a general computer such as a personal computer is heavy in computational load, and continues to update the volume rendering image following the user's mouse operation. It is difficult. Therefore, in the third embodiment of the present invention, a method of suppressing the calculation load while the user changes the viewpoint by mouse drag will be described. The configuration of the ray casting apparatus 100 is the same as that of the first embodiment.

図8は、ユーザがマウスをドラッグすることにより視点を変更するときのレイキャスティング装置100が生成するボリュームレンダリング画像の例である。図8左図はユーザがマウスをドラッグしている間における画像である。図8右図はユーザがマウスドラッグを終了した後の画像である。   FIG. 8 is an example of a volume rendering image generated by the ray casting apparatus 100 when the viewpoint is changed by the user dragging the mouse. The left figure of FIG. 8 is an image while the user is dragging the mouse. The right figure of FIG. 8 is an image after the user finishes the mouse drag.

レイキャスティング装置100は、ユーザがマウスをドラッグすることにより視点を変更するよう指示する座標変換パラメータの入力を受け取る。レイキャスティング処理部124および表示部125は、ユーザがマウスをドラッグしている間は、ボリュームレンダリング画像の画素を間引いて画像を生成して、出力先の装置またはデバイスに拡大して表示されるように出力する。例えばxy方向ともに4画素ごとに間引いた画像を生成し、縦横4倍に拡大させて表示する。図8左図は画素を間引いた画像例である。これにより、ユーザがマウスをドラッグしている間においては、ボリュームレンダリング画像をリアルタイムで生成できる程度に演算負荷を抑制できる。ただし、画素の間引き条件は、パーソナルコンピュータのCPU性能とソースのボクセル画像のボクセル数により適宜変更する必要がある。図8の例は、ソースのボクセル画像がx:512×y:512×z:370、Z方向変倍率:1.4に対して、図8右図に示す512×512画素の診断用途のボリュームレンダリング画像を生成する場合で、図8左図に示す縦横4画素ごとに間引いた128×128画素の画像であれば、演算負荷が1/16に抑制され一般的なパーソナルコンピュータでリアルタイム(0.1秒以下)に生成することができる。図8左図ではz方向に対しては間引きを行っていないが、z方向に対しても同様に4画素ごとに間引くことができ、その場合は演算負荷が1/64に抑制されるため、一般的なパーソナルコンピュータより処理能力が低いタブレット端末等でもリアルタイムに生成することができる。   The ray casting apparatus 100 receives an input of a coordinate conversion parameter that instructs the user to change the viewpoint by dragging the mouse. The ray casting processing unit 124 and the display unit 125 generate an image by thinning out the pixels of the volume rendering image while the user is dragging the mouse, and display the enlarged image on the output destination apparatus or device. Output to. For example, an image that is thinned out every four pixels in the xy direction is generated, and enlarged and displayed four times in length and width. The left figure of FIG. 8 is an example of an image with pixels thinned out. Thereby, while the user is dragging the mouse, the calculation load can be suppressed to such an extent that a volume rendering image can be generated in real time. However, the pixel thinning condition needs to be changed as appropriate depending on the CPU performance of the personal computer and the number of voxels in the source voxel image. In the example of FIG. 8, the source voxel image is x: 512 × y: 512 × z: 370 and the Z-direction magnification is 1.4, and the volume for diagnostic use of 512 × 512 pixels shown in the right diagram of FIG. In the case of generating a rendering image, if the image is 128 × 128 pixels thinned out every four pixels in the vertical and horizontal directions shown in the left diagram of FIG. 8, the calculation load is suppressed to 1/16 and real time (0. 1 second or less). In the left diagram of FIG. 8, thinning is not performed in the z direction, but thinning can also be performed in every four pixels in the z direction. In this case, the calculation load is suppressed to 1/64. Even a tablet terminal having a processing capability lower than that of a general personal computer can be generated in real time.

レイキャスティング装置100は、ユーザがマウスドラッグを完了すると(すなわちユーザがマウスボタンから指を離すと)、その旨の信号を受け取る。レイキャスティング処理部124および表示部125は、ドラッグ完了後は画素を間引かずに図8右図のようなボリュームレンダリング画像を生成して、出力先の装置またはデバイスに応じて画像データを処理して出力する。   When the user completes the mouse drag (that is, when the user releases the mouse button), the ray casting apparatus 100 receives a signal to that effect. The ray casting processing unit 124 and the display unit 125 generate a volume rendering image as shown in the right diagram of FIG. 8 without thinning out pixels after the completion of dragging, and process the image data according to the output destination apparatus or device. Output.

<本発明の変形例について>
本発明は上記した実施形態に限定されるものではなく、様々な変形例が含まれる。例えば、上記した実施形態は本発明を分かりやすく説明するために詳細に説明したものであり、必ずしも説明した全ての構成を備えるものに限定されるものではない。また、ある実施形態の構成の一部を他の実施形態の構成に置き換えることが可能であり、また、ある実施形態の構成に他の実施形態の構成を加えることも可能である。また、各実施形態の構成の一部について、他の構成の追加・削除・置換をすることが可能である。
<Modification of the present invention>
The present invention is not limited to the embodiments described above, and includes various modifications. For example, the above-described embodiment has been described in detail for easy understanding of the present invention, and is not necessarily limited to one having all the configurations described. Further, a part of the configuration of an embodiment can be replaced with the configuration of another embodiment, and the configuration of another embodiment can be added to the configuration of an embodiment. In addition, it is possible to add, delete, and replace other configurations for a part of the configuration of each embodiment.

以上の実施形態において、ボクセル画像作成部121は、ボクセル画像に対してスムージングを実施してもよい。例えばあるボクセルのx方向、y方向、z方向の各方向において隣接するボクセル(例えば、26個の隣接するボクセル)の不透明度の代表値(例えば、平均値)を、中心ボクセルの不透明度として採用した上で、ボクセル画像を作成することができる。この時、色値に対してはスムージングを掛けないようにすると、スムージングの演算負荷を1/4に抑制できるとともに、生成されるボリュームレンダリング画像のボケを抑制することができる。ボクセルを参照する際に座標変換と併せて本発明に係る手法を実施する形態をとることもできるが、その場合、ボクセル座標系において参照されるボクセルに対して重複してスムージング処理が行われるため、演算負荷が却って増大する場合があるので、ボクセルのスムージングは起点座標の探索やレイキャスティング処理よりも前(例えばステップS210)に実施することが望ましい。   In the above embodiment, the voxel image creation unit 121 may perform smoothing on the voxel image. For example, a representative value (for example, an average value) of opacity of adjacent voxels (for example, 26 adjacent voxels) in each of the x, y, and z directions of a certain voxel is adopted as the opacity of the central voxel. In addition, a voxel image can be created. At this time, if smoothing is not applied to the color value, the calculation load of smoothing can be reduced to ¼ and blurring of the generated volume rendering image can be suppressed. When referring to a voxel, the method according to the present invention can be implemented together with coordinate transformation, but in this case, since the voxel referred to in the voxel coordinate system is overlapped, smoothing processing is performed. Since the computation load may increase on the contrary, it is desirable that the smoothing of the voxels is performed before the search for the origin coordinates and the ray casting process (for example, step S210).

以上の実施形態において、ボクセル画像作成部121は、ボクセル画像の各ボクセルに対して陰影値を算出し、その陰影値を各ボクセルの色値に乗算することにより、ボリュームレンダリング画像に陰影を付加するようにしてもよい。陰影の中の拡散反射成分は、各ボクセルに隣接する26近傍または6近傍のボクセル(xyz各座標軸方向において2近傍)の不透明度の3次元的な変化を3次元勾配ベクトルとして算出し、その勾配ベクトルの単位ベクトルとあらかじめ定義された光源ベクトル(平行光の3次元的な方向を示す単位ベクトル)との内積をとることにより、計算することができる。不透明度の勾配ベクトルを算出する際に隣接ボクセルを参照する必要があるので、スムージングと同様に陰影計算は起点座標の探索やレイキャスティング処理よりも前(例えばステップS210)で、スムージング処理を実施する場合はスムージング処理を実施した後に実施することが望ましい。   In the above embodiment, the voxel image creation unit 121 calculates a shadow value for each voxel of the voxel image, and multiplies the color value of each voxel to add a shadow to the volume rendering image. You may do it. The diffuse reflection component in the shade is calculated as a three-dimensional gradient vector of a three-dimensional change in opacity of 26 or six adjacent voxels adjacent to each voxel (two adjacent in the xyz coordinate axis directions). The calculation can be performed by taking the inner product of the unit vector of the vector and a predefined light source vector (unit vector indicating the three-dimensional direction of parallel light). Since it is necessary to refer to adjacent voxels when calculating the gradient vector of opacity, the smoothing process is performed before the search for the origin coordinates and the ray casting process (for example, step S210) in the same manner as the smoothing. In such a case, it is desirable that the smoothing process be performed.

以上の実施形態においては、探索制御テーブルのうち奇数番目の画素を補完する例を説明したが、これに代えて偶数番目の画素を補完してもよい。xy方向いずれにおいても同様である。また、縦横1画素置きではなく、縦横M(>1)画素置きに起点座標の探索を行い、間に挟まれているM個の各画素を両隣の画素を基に補間するようにしてもよく、その場合は演算負荷を更に抑制することができる。   In the above embodiment, an example of complementing odd-numbered pixels in the search control table has been described, but even-numbered pixels may be complemented instead. The same applies to any of the xy directions. Alternatively, the origin coordinates may be searched for every vertical and horizontal M (> 1) pixels instead of every other vertical and horizontal pixels, and the M pixels sandwiched between them may be interpolated based on both adjacent pixels. In this case, the calculation load can be further suppressed.

以上の実施形態においては、ボクセル画像作成部121、座標変換部122、起点座標探索部123、レイキャスティング処理部124を個別のモジュールとして記載したが、これらのうち2以上を一体のモジュールとして構成することもできる。さらにこれらモジュールを全体として1つのレイキャスティングプログラムとしてCPU110が実行することもできる。   In the above embodiment, the voxel image creation unit 121, the coordinate conversion unit 122, the starting point coordinate search unit 123, and the ray casting processing unit 124 are described as individual modules, but two or more of these are configured as an integrated module. You can also Furthermore, the CPU 110 can execute these modules as one ray casting program as a whole.

上記の各構成、機能、処理部、処理手段等は、それらの一部又は全部を、例えば集積回路で設計する等によりハードウェアで実現してもよい。また、上記の各構成、機能等は、プロセッサがそれぞれの機能を実現するプログラムを解釈し、実行することによりソフトウェアで実現してもよい。各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリや、ハードディスク、SSD(Solid State Drive)等の記録装置、または、ICカード、SDカード等の可搬記録媒体に置くことができる。可搬記録媒体にプログラムを格納した場合、その記録媒体をドライブから読み出してプログラムを実行することができる。   Each of the above-described configurations, functions, processing units, processing means, and the like may be realized by hardware by designing a part or all of them with, for example, an integrated circuit. Each of the above-described configurations, functions, and the like may be realized by software by interpreting and executing a program that realizes each function by the processor. Information such as programs, tables, and files for realizing each function can be stored in a memory, a hard disk, a recording device such as an SSD (Solid State Drive), or a portable recording medium such as an IC card or an SD card. When a program is stored on a portable recording medium, the program can be executed by reading the recording medium from the drive.

図9は、各機能部をプログラムとして構成した場合の構成例である。例えば記憶部130として上述した記憶装置または記憶媒体を用い、ボクセル画像作成部121〜レイキャスティング処理部124までの各機能部をプログラムとして構成して記憶部130に格納することができる。CPU110が記憶部130からこれらプログラムを読み出して実行することにより、レイキャスティング装置100の機能を実装することができる。そして、レイキャスティング処理部124で生成されるボリューレムレンダリング画像を表示部125に渡して視覚的に閲覧可能にする。   FIG. 9 is a configuration example when each functional unit is configured as a program. For example, the above-described storage device or storage medium may be used as the storage unit 130, and each functional unit from the voxel image creation unit 121 to the ray casting processing unit 124 may be configured as a program and stored in the storage unit 130. When the CPU 110 reads out and executes these programs from the storage unit 130, the function of the ray casting apparatus 100 can be implemented. Then, the volume rendering image generated by the ray casting processing unit 124 is passed to the display unit 125 so that it can be visually browsed.

100:レイキャスティング装置
110:CPU
121:ボクセル画像作成部
122:座標変換部
123:起点座標探索部
124:レイキャスティング処理部
125:表示部
130:記憶部
100: Ray casting device 110: CPU
121: Voxel image creation unit 122: Coordinate conversion unit 123: Origin coordinate search unit 124: Ray casting processing unit 125: Display unit 130: Storage unit

Claims (16)

対象物を断層撮影することによって取得した断層画像に対してレイキャスティング法を用いてボリュームレンダリング画像を生成する処理をコンピュータに実行させるレイキャスティングプログラムであって、前記コンピュータに、
前記断層画像のボクセル値を基に設定された色値と不透明度を有する前記対象物のボクセル画像を前記断層画像から作成するボクセル画像作成ステップ、
前記対象物に対する視点(x,y,0)を基準とした3次元(x,y,z)の視点座標系を、前記ボクセル画像の座標系に変換するパラメータであって、同一の前記視点に対して共通に用いる座標変換パラメータを算出する、座標変換パラメータ算出ステップ、
前記視点から前記視点座標系のz方向に沿って、前記座標変換パラメータを用いて座標変換を行いながら前記ボクセル画像を参照することにより、前記視点座標系のz座標のうち不透明度が0ではないものを起点座標として設定する起点座標探索ステップ、
前記起点座標を起点として前記視点座標系のz方向に沿って、前記座標変換パラメータを用いて座標変換を行いながら前記ボクセル画像のボクセルの色値と不透明度を取得して前記ボリュームレンダリング画像の画素(x,y)の画素値を算出するレイキャスティングステップ、
を実行させる
ことを特徴とするレイキャスティングプログラム。
A ray casting program for causing a computer to execute a process of generating a volume rendering image using a ray casting method on a tomographic image acquired by tomographic imaging of an object,
A voxel image creating step for creating a voxel image of the object having the color value and opacity set based on the voxel value of the tomographic image from the tomographic image;
This is a parameter for converting a three-dimensional (x, y, z) viewpoint coordinate system based on the viewpoint (x, y, 0) with respect to the object to the coordinate system of the voxel image. A coordinate conversion parameter calculation step for calculating a coordinate conversion parameter used in common,
By referring to the voxel image while performing coordinate conversion using the coordinate conversion parameter from the viewpoint along the z direction of the viewpoint coordinate system, opacity is not zero among the z coordinates of the viewpoint coordinate system. An origin coordinate search step for setting an object as an origin coordinate;
A pixel of the volume rendering image is obtained by obtaining a color value and opacity of the voxel of the voxel image while performing coordinate transformation using the coordinate transformation parameter along the z direction of the viewpoint coordinate system starting from the origin coordinate. A ray casting step for calculating a pixel value of (x, y);
A ray casting program characterized in that
前記起点座標探索ステップにおいては、前記コンピュータに、
前記視点から前記視点座標系のz方向に沿って2ボクセル以上のボクセル間隔ごとに前記ボクセル画像の不透明度を取得することにより、不透明度が0ではない最初の不透明ボクセルを探索するステップ、
前記最初のボクセルより前記視点の方向に、前記視点座標系のz方向に沿って1ボクセルごとに前記ボクセル画像の不透明度を取得することにより、不透明度が0である最初の透明ボクセルを探索するステップ、
前記最初の透明ボクセルに隣接する不透明度が0ではないボクセルの前記視点座標系におけるz座標を前記起点座標として特定するステップ、
を実行させる
ことを特徴とする請求項1記載のレイキャスティングプログラム。
In the starting point coordinate search step, the computer,
Searching for the first opaque voxel whose opacity is not 0 by obtaining the opacity of the voxel image at intervals of 2 voxels or more from the viewpoint along the z direction of the viewpoint coordinate system;
The first transparent voxel having an opacity of 0 is searched by obtaining the opacity of the voxel image for each voxel in the direction of the viewpoint from the first voxel and along the z direction of the viewpoint coordinate system. Step,
Identifying the z-coordinate in the viewpoint coordinate system of a voxel with non-opacity of 0 adjacent to the first transparent voxel as the origin coordinate,
The ray casting program according to claim 1, wherein:
前記ボリュームレンダリング画像は、xy方向それぞれに画素を有しており、
前記起点座標探索ステップにおいては、前記コンピュータに、
前記ボリュームレンダリング画像の一部の画素に対して、対応する前記ボクセル値を参照することにより、当該画素に対応する前記起点座標を探索し、前記起点座標を設定する第1のステップ、
前記第1のステップで探索した前記ボリュームレンダリング画像の画素の起点座標を参照しながら、前記第1のステップで探索しなかった前記ボリュームレンダリング画像の他の画素に対応する前記起点座標を設定する第2のステップ、
を実行させる
ことを特徴とする請求項1または請求項2のいずれかに記載のレイキャスティングプログラム。
The volume rendering image has pixels in each of the xy directions,
In the starting point coordinate search step, the computer,
A first step of searching for a starting point coordinate corresponding to the pixel by referring to the corresponding voxel value for a part of the pixels of the volume rendering image, and setting the starting point coordinate;
While referring to the origin coordinates of the pixels of the volume rendering image searched in the first step, the origin coordinates corresponding to other pixels of the volume rendering image not searched in the first step are set. Two steps,
The ray casting program according to claim 1, wherein the ray casting program is executed.
前記ボリュームレンダリング画像は、xy方向それぞれに画素を有しており、
前記起点座標探索ステップにおいては、前記コンピュータに、
前記ボリュームレンダリング画像のx方向およびy方向に沿ってM(Mは1以上の整数)画素飛ばしに前記起点座標を探索し、前記起点座標を設定する第1のステップ、
前記第1のステップにおいて探索された、第1画素に対応する起点座標とx方向にM画素飛ばして隣接する第2画素に対応する起点座標が等しい場合は、x方向に前記第1画素と前記第2画素との間にx方向に配置されているM個の各画素に対応する起点座標として、前記第1画素に対応する前記起点座標と同じz座標値を設定する第2のステップ、
前記第1のステップおよび前記第2のステップにおいて設定された、第3画素に対応する起点座標とy方向にM画素飛ばして隣接する第4画素に対応する起点座標が等しい場合は、y方向に前記第3画素と前記第4画素との間にy方向に配置されているM個の各画素に対応する起点座標として、前記第3画素に対応する前記起点座標と同じz座標値を設定する第3のステップ、
を実行させる
ことを特徴とする請求項1または請求項2のいずれかに記載のレイキャスティングプログラム。
The volume rendering image has pixels in each of the xy directions,
In the starting point coordinate search step, the computer,
A first step of searching the starting point coordinates for skipping M (M is an integer of 1 or more) pixels along the x and y directions of the volume rendering image, and setting the starting point coordinates;
When the origin coordinates corresponding to the first pixel searched for in the first step and the origin coordinates corresponding to the adjacent second pixel after skipping M pixels in the x direction are the same, the first pixel and the A second step of setting the same z coordinate value as the starting point coordinate corresponding to the first pixel as the starting point coordinate corresponding to each of the M pixels arranged in the x direction between the second pixel and the second pixel;
When the starting point coordinates corresponding to the third pixel set in the first step and the second step are the same as the starting point coordinates corresponding to the adjacent fourth pixel after skipping M pixels in the y direction, The same z-coordinate value as the starting point coordinate corresponding to the third pixel is set as the starting point coordinate corresponding to each of the M pixels arranged in the y direction between the third pixel and the fourth pixel. The third step,
The ray casting program according to claim 1, wherein the ray casting program is executed.
前記起点座標探索ステップにおいては、前記コンピュータに、前記ボリュームレンダリング画像の全ての画素について前記起点座標を設定した上でその結果を記録する探索制御テーブルを作成させ、
前記レイキャスティングステップにおいては、前記コンピュータに、前記探索制御テーブルが記録している前記起点座標を起点として、前記ボリュームレンダリング画像の画素値を算出させる
ことを特徴とする請求項1から請求項4のいずれか一項に記載のレイキャスティングプログラム。
In the starting point coordinate search step, the computer is made to create a search control table that records the result after setting the starting point coordinates for all the pixels of the volume rendering image,
5. The ray casting step according to claim 1, wherein, in the ray casting step, the computer is configured to calculate a pixel value of the volume rendering image using the starting point coordinates recorded in the search control table as a starting point. The ray casting program according to any one of the above.
前記起点座標探索ステップにおいては、前記コンピュータに、前記座標変換パラメータを用いて座標変換を行いながら前記ボクセル画像を参照する際、ボクセルが有する色値を参照することなく不透明度を参照することにより、前記起点座標を探索させる
ことを特徴とする請求項1から請求項5のいずれか一項に記載のレイキャスティングプログラム。
In the starting point coordinate search step, when referring to the voxel image while performing coordinate conversion using the coordinate conversion parameter, the computer refers to the opacity without referring to the color value of the voxel, The ray casting program according to claim 1, wherein the starting point coordinates are searched.
前記起点座標探索ステップにおいては、前記コンピュータに、
前記ボクセル画像の範囲内において前記最初の不透明ボクセルが見つからなかった場合は、前記起点座標としてその旨を表す値を設定するステップを実行させ、
前記レイキャスティングステップにおいては、前記コンピュータに、
前記起点座標として前記最初の不透明ボクセルが見つからなかった旨を表す値が設定されている場合は、その起点座標を起点として前記ボリュームレンダリング画像の画素値を算出する処理をスキップさせ、所定の背景色を示す画素値を設定する
ことを特徴とする請求項2記載のレイキャスティングプログラム。
In the starting point coordinate search step, the computer,
When the first opaque voxel is not found within the range of the voxel image, the step of setting a value representing that as the starting point coordinate is executed,
In the ray casting step, the computer
When a value indicating that the first opaque voxel has not been found is set as the starting point coordinates, the processing for calculating the pixel value of the volume rendering image with the starting point coordinates as a starting point is skipped, and a predetermined background color The ray casting program according to claim 2, wherein a pixel value indicating is set.
前記レイキャスティングステップにおいては、前記コンピュータに、
前記視点から前記視点座標系のz方向に沿って前記ボクセル画像の各ボクセルの不透明度を取得することにより、不透明度が0である透明ボクセルであるか否かを判定する、不透明度判定ステップ、
前記不透明度判定ステップにおいて判定された透明ボクセルから開始して、不透明度が0ではない不透明ボクセルに至るまで、前記z方向に沿って前記ボクセル画像の各ボクセルの不透明度を取得する、不透明ボクセル探索ステップ、
前記透明ボクセルから前記不透明ボクセルのz方向に1つ前に位置するボクセルまでの一連のボクセルに対して、前記ボリュームレンダリング画像の画素値を算出する処理をスキップするステップ、
を実行させる
ことを特徴とする請求項1から請求項7のいずれか一項に記載のレイキャスティングプログラム。
In the ray casting step, the computer
An opacity determination step of determining whether or not the voxel image is a transparent voxel having an opacity of 0 by obtaining the opacity of each voxel of the voxel image along the z direction of the viewpoint coordinate system from the viewpoint.
An opaque voxel search that starts from the transparent voxel determined in the opacity determination step and obtains the opacity of each voxel of the voxel image along the z-direction until reaching an opaque voxel whose opacity is not zero. Step,
Skipping the process of calculating the pixel value of the volume rendering image for a series of voxels from the transparent voxel to the voxel located immediately before in the z-direction of the opaque voxel;
The ray casting program according to claim 1, wherein the ray casting program is executed.
前記不透明ボクセル探索ステップにおいては、前記コンピュータに、
前記透明ボクセルから開始して、前記z方向に沿って2ボクセル以上のボクセル間隔ごとに前記ボクセル画像の不透明度を取得することにより、不透明度が0ではない最初の不透明ボクセルを探索するステップ、
前記最初の不透明ボクセルから前記透明ボクセルへ向かう方向に、前記z方向に沿って1ボクセルごとに前記ボクセル画像の不透明度を取得することにより、不透明度が0である最初の透明ボクセルを探索するステップ、
前記最初の透明ボクセルに隣接する不透明度が0ではない不透明ボクセルより前記レイキャスティングステップを再開させるように制御するステップ、
を実行させる
ことを特徴とする請求項8に記載のレイキャスティングプログラム。
In the opaque voxel search step, the computer
Searching for the first opaque voxel whose opacity is not zero by obtaining the opacity of the voxel image for each voxel interval of two or more voxels along the z direction, starting from the transparent voxel;
Searching for the first transparent voxel with zero opacity by obtaining the opacity of the voxel image for each voxel along the z direction in the direction from the first opaque voxel to the transparent voxel. ,
Controlling the ray casting step to resume from opaque voxels with non-zero opacity adjacent to the first transparent voxel;
The ray casting program according to claim 8, wherein the ray casting program is executed.
前記レイキャスティングプログラムは、前記コンピュータにさらに、前記視点を変更する座標変換パラメータを指示する座標変換パラメータの入力を受け取るステップを実行させるとともに
前記座標変換パラメータの入力を受け取るごとに、前記座標変換パラメータ算出ステップ、前記起点座標探索ステップおよび前記レイキャスティングステップを実行させて、前記ボリュームレンダリング画像を繰り返し表示するようにし、
前記起点座標探索ステップおよび前記レイキャスティングステップにおいては、前記コンピュータに、前記座標変換パラメータの入力を受け取っている間の期間においては、前記ボリュームレンダリング画像の画素のうち少なくとも一部を間引く間引き処理を実施したうえで起点座標を設定するとともに画素値を算出させ、
前記起点座標探索ステップおよび前記レイキャスティングステップにおいては、前記コンピュータに、前記座標変換パラメータの入力が停止した時点で前記間引き処理を実施せずに起点座標を設定するとともに画素値を算出させる
ことを特徴とする請求項1から請求項9のいずれか一項に記載のレイキャスティングプログラム。
The ray casting program further causes the computer to execute a step of receiving an input of a coordinate conversion parameter for instructing a coordinate conversion parameter for changing the viewpoint, and each time the input of the coordinate conversion parameter is received, the coordinate conversion parameter calculation is performed. Step, the origin coordinate search step and the ray casting step are executed to repeatedly display the volume rendering image,
In the starting point coordinate search step and the ray casting step, a thinning process for thinning out at least a part of the pixels of the volume rendering image is performed during a period during which the computer receives the input of the coordinate conversion parameter. After that, set the starting point coordinates and calculate the pixel value,
In the starting point coordinate search step and the ray casting step, the computer sets the starting point coordinate and calculates a pixel value without performing the thinning process when the input of the coordinate conversion parameter is stopped. The ray casting program according to any one of claims 1 to 9.
前記ボクセル画像作成ステップにおいては、前記コンピュータに、対象ボクセルの不透明度を算出するステップを実行させ、
前記ボクセル画像作成ステップにおいては、前記コンピュータに、前記対象ボクセルに隣接する26個のボクセルがそれぞれ有する不透明度の平均値によって前記対象ボクセルが有する不透明度を更新するステップを実行させる
ことを特徴とする請求項1から請求項10のいずれか一項に記載のレイキャスティングプログラム。
In the voxel image creation step, the computer is caused to execute a step of calculating the opacity of the target voxel,
In the voxel image creating step, the computer is caused to execute a step of updating the opacity of the target voxel by an average value of opacity of each of the 26 voxels adjacent to the target voxel. The ray casting program according to any one of claims 1 to 10.
前記起点座標探索ステップにおいては、前記コンピュータに、前記座標変換パラメータを用いて座標変換を行いながら前記ボクセル画像を参照することにより、起点座標を設定する際、前記ボクセル画像のボクセル間の中間座標を加味して座標変換を行い、前記起点座標探索ステップをN(N>1)回実行させ、
前記レイキャスティングステップにおいては、前記コンピュータに、前記座標変換パラメータを用いて座標変換を行いながら前記ボクセル画像の色値と不透明度を取得して前記ボリュームレンダリング画像の画素値を算出する際、前記中間座標を加味して座標変換を行い、前記レイキャスティングステップをN回実行させ、算出されたN個のボリュームレンダリング画像の画素値を平均することにより、前記ボリュームレンダリング画像の画素値を算出する
ことを特徴とする請求項1から請求項11のいずれか一項に記載のレイキャスティングプログラム。
In the starting point coordinate search step, when setting the starting point coordinates by referring to the voxel image while performing coordinate conversion using the coordinate conversion parameter, the intermediate coordinates between the voxels of the voxel image are set in the computer. In consideration of the coordinate transformation, the origin coordinate search step is executed N (N> 1) times,
In the ray casting step, when calculating the pixel value of the volume rendering image by obtaining the color value and opacity of the voxel image while performing coordinate conversion using the coordinate conversion parameter, Performing coordinate transformation in consideration of coordinates, causing the ray casting step to be executed N times, and calculating pixel values of the volume rendering image by averaging the pixel values of the calculated N volume rendering images. The ray casting program according to any one of claims 1 to 11, wherein the ray casting program is characterized in that:
対象物を断層撮影することによって取得した断層画像に対してレイキャスティング法を用いて生成するボリュームレンダリング画像の画素値を算出する際、前記断層画像のボクセル値を基に設定された色値と不透明度を有する前記対象物のボクセル画像に対して、レイキャスティング法を実行するための起点となる、視点から視点座標系のz方向に最初に存在する不透明度が0でない不透明ボクセルのz座標を起点座標として設定した構造を有する探索制御データであって、
前記探索制御データは、前記ボリュームレンダリング画像の画素ごとに前記起点座標を設定されており、
各前記画素に対応する前記起点座標のうち少なくとも一部は、x方向または/かつy方向に連続するM個(M>2)の前記画素について同じ値が設定されており、
各前記画素に対応する前記起点座標のうち少なくとも一部は、視点から視点座標系のz方向の末端まで不透明度が0でない不透明ボクセルが存在しない旨を表す値が設定されている
ことを特徴とする探索制御データ。
When calculating a pixel value of a volume rendering image generated by using the ray casting method for a tomographic image acquired by tomographic imaging of an object, the color value set based on the voxel value of the tomographic image and an For the voxel image of the object having transparency, the starting point is the z-coordinate of the opaque voxel that is the first starting point in the z-direction of the viewpoint coordinate system from the viewpoint and whose opacity is not zero, which is the starting point for executing the ray casting method. Search control data having a structure set as coordinates,
In the search control data, the starting point coordinates are set for each pixel of the volume rendering image,
At least a part of the starting point coordinates corresponding to each of the pixels is set to the same value for M pixels (M> 2) continuous in the x direction and / or the y direction,
At least a part of the origin coordinates corresponding to each of the pixels is set to a value indicating that there is no opaque voxel with non-opacity from the viewpoint to the end in the z direction of the viewpoint coordinate system. Search control data to be performed.
対象物を断層撮影することによって取得した断層画像に対してレイキャスティング法を用いて生成するボリュームレンダリング画像の画素値を算出する際、レイキャスティング法を実行するための起点となる、視点から視点座標系のz方向に最初に存在する不透明度が0でない不透明ボクセルのz座標を起点座標として記述する探索制御データを生成する探索制御データ生成方法であって、
前記対象物に対する視点から視点座標系のz方向に沿って前記対象物のボクセル画像を参照することにより、前記ボクセル画像の不透明度が0ではない不透明ボクセルの視点座標系におけるz座標を起点座標として探索する起点座標探索ステップ、
前記起点座標を前記探索制御データに記録するステップ、
を有し、
前記ボリュームレンダリング画像は、xy方向それぞれに画素を有しており、
前記起点座標探索ステップは、
前記ボリュームレンダリング画像のx方向およびy方向に沿ってM(Mは1以上の整数)画素飛ばしに、対応する前記ボクセル画像のボクセル値を参照することにより、前記起点座標を探索し、前記起点座標を設定する第1のステップ、
前記第1のステップにおいて探索された、第1画素に対応する起点座標とx方向にM画素飛ばして隣接する第2画素に対応する起点座標が等しい場合は、前記第1画素と前記第2画素との間にx方向に配置されているM個の各画素に対応する前記起点座標として、前記第1画素に対応する前記起点座標と同じz座標値を設定する第2のステップ、
前記第1のステップおよび前記第2のステップにおいて設定された、第3画素に対応する起点座標とy方向にM画素飛ばして隣接する第4画素に対応する起点座標が等しい場合は、前記第3画素と前記第4画素との間にy方向に配置されているM個の各画素に対応する前記起点座標として、前記第3画素に対応する前記起点座標と同じz座標値を設定する第3のステップ、
を有する
ことを特徴とする探索制御データ生成方法。
When calculating pixel values of a volume rendering image generated using the ray casting method for a tomographic image acquired by tomographic imaging of an object, viewpoint coordinates from the viewpoint, which is the starting point for executing the ray casting method A search control data generation method for generating search control data describing, as a starting point coordinate, an opaque voxel having an opacity that is initially zero in the z direction of the system,
By referring to the voxel image of the object from the viewpoint with respect to the object along the z direction of the viewpoint coordinate system, the z coordinate in the viewpoint coordinate system of the opaque voxel in which the opacity of the voxel image is not 0 is set as the origin coordinate. An origin coordinate search step to search;
Recording the starting point coordinates in the search control data;
Have
The volume rendering image has pixels in each of the xy directions,
The origin coordinate search step includes:
The origin coordinate is searched by referring to the voxel value of the corresponding voxel image for skipping M (M is an integer of 1 or more) pixels along the x and y directions of the volume rendering image. The first step of setting
When the starting point coordinates corresponding to the first pixel searched for in the first step and the starting point coordinates corresponding to the adjacent second pixel after skipping M pixels in the x direction are equal, the first pixel and the second pixel A second step of setting the same z coordinate value as the starting point coordinate corresponding to the first pixel as the starting point coordinate corresponding to each of the M pixels arranged in the x direction between
In the case where the starting point coordinates corresponding to the third pixel set in the first step and the second step are the same as the starting point coordinates corresponding to the adjacent fourth pixel after skipping M pixels in the y direction, the third A third z-coordinate value that is the same as the starting point coordinate corresponding to the third pixel is set as the starting point coordinate corresponding to each of the M pixels arranged in the y direction between the pixel and the fourth pixel. Steps,
A search control data generation method characterized by comprising:
前記起点座標探索ステップの前記第1のステップにおいて、視点から視点座標系のz方向の終端まで不透明度が0でない不透明ボクセルが存在しない場合は、前記起点座標としてその旨を表す値を設定する
ことを特徴とする請求項14記載の探索制御データ生成方法。
In the first step of the starting point coordinate search step, if there is no opaque voxel with non-opacity from the viewpoint to the end in the z direction of the viewpoint coordinate system, a value indicating that is set as the starting point coordinate. The search control data generation method according to claim 14.
対象物を断層撮影することによって取得した断層画像に対してレイキャスティング法を用いてボリュームレンダリング画像を生成するレイキャスティング装置であって、
ボクセル値として色値と不透明度を有する前記対象物のボクセル画像を前記断層画像から作成するボクセル画像作成部、
前記ボクセル画像の座標系を、前記対象物に対する視点(x,y,0)を基準とした3次元(x,y,z)の視点座標系に変換するパラメータであって、同一の前記視点に対して共通に用いる座標変換パラメータを算出する、座標変換パラメータ算出部、
前記視点から前記視点座標系のz方向に沿って、前記座標変換パラメータを用いて座標変換を行いながら前記ボクセル画像を参照することにより、前記視点座標系のz座標のうち不透明度が0ではないものを起点座標として設定する起点座標探索部、
前記起点座標を起点として前記視点座標系のz方向に沿って、前記座標変換パラメータを用いて座標変換を行いながら前記ボクセル画像のボクセルの色値と不透明度を取得して前記ボリュームレンダリング画像の画素(x,y)の画素値を算出するレイキャスティング処理部、
を備えている
ことを特徴とするレイキャスティング装置。
A ray casting apparatus that generates a volume rendering image using a ray casting method for a tomographic image acquired by tomographic imaging of an object,
A voxel image creating unit that creates a voxel image of the object having a color value and opacity as a voxel value from the tomographic image;
Parameters for converting the coordinate system of the voxel image into a three-dimensional (x, y, z) viewpoint coordinate system based on the viewpoint (x, y, 0) with respect to the object, A coordinate conversion parameter calculator that calculates coordinate conversion parameters used in common,
By referring to the voxel image while performing coordinate conversion using the coordinate conversion parameter from the viewpoint along the z direction of the viewpoint coordinate system, opacity is not zero among the z coordinates of the viewpoint coordinate system. An origin coordinate search unit for setting an object as an origin coordinate,
A pixel of the volume rendering image is obtained by obtaining a color value and opacity of the voxel of the voxel image while performing coordinate transformation using the coordinate transformation parameter along the z direction of the viewpoint coordinate system starting from the origin coordinate. A ray casting processing unit for calculating a pixel value of (x, y);
A ray casting apparatus characterized by comprising:
JP2018052411A 2018-03-20 2018-03-20 Ray casting program, search control data, search control data generation method, and ray casting apparatus Active JP6443574B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018052411A JP6443574B1 (en) 2018-03-20 2018-03-20 Ray casting program, search control data, search control data generation method, and ray casting apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018052411A JP6443574B1 (en) 2018-03-20 2018-03-20 Ray casting program, search control data, search control data generation method, and ray casting apparatus

Publications (2)

Publication Number Publication Date
JP6443574B1 JP6443574B1 (en) 2018-12-26
JP2019164619A true JP2019164619A (en) 2019-09-26

Family

ID=64899510

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018052411A Active JP6443574B1 (en) 2018-03-20 2018-03-20 Ray casting program, search control data, search control data generation method, and ray casting apparatus

Country Status (1)

Country Link
JP (1) JP6443574B1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116196022B (en) * 2023-04-28 2023-08-04 之江实验室 Flux distribution calculation method and system for fan-shaped X-ray beam passing through medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3483929B2 (en) * 1994-04-05 2004-01-06 株式会社日立製作所 3D image generation method
JP2001216517A (en) * 2000-02-04 2001-08-10 Zio Software Inc Object recognition method
GB2415876B (en) * 2004-06-30 2007-12-05 Voxar Ltd Imaging volume data
JP4260177B2 (en) * 2006-09-27 2009-04-30 ザイオソフト株式会社 Image processing method

Also Published As

Publication number Publication date
JP6443574B1 (en) 2018-12-26

Similar Documents

Publication Publication Date Title
EP1004988B1 (en) Method, apparatus and computer program product for generating perspective corrected data from warped information
US10692272B2 (en) System and method for removing voxel image data from being rendered according to a cutting region
US8493389B2 (en) 3D connected shadow mouse pointer
US20110262015A1 (en) Image processing apparatus, image processing method, and storage medium
EP2080170B1 (en) Combined intensity projection
US8659602B2 (en) Generating a pseudo three-dimensional image of a three-dimensional voxel array illuminated by an arbitrary light source by a direct volume rendering method
US20050237336A1 (en) Method and system for multi-object volumetric data visualization
JP2006055213A (en) Image processor and program
JP4885042B2 (en) Image processing method, apparatus, and program
JPH0528243A (en) Image-forming device
US20220343589A1 (en) System and method for image processing
US11494972B2 (en) Image processing apparatus, image processing method, and image processing system
EP2727078B1 (en) Zooming of medical images
JP2006000127A (en) Image processing method, apparatus and program
JP6443574B1 (en) Ray casting program, search control data, search control data generation method, and ray casting apparatus
US8416239B2 (en) Intermediate image generation method, apparatus, and program
JP5065740B2 (en) Image processing method, apparatus, and program
US9035945B1 (en) Spatial derivative-based ray tracing for volume rendering
JP7131080B2 (en) volume rendering device
JP2006000126A (en) Image processing method, apparatus and program
CN114998150B (en) Three-dimensional reconstruction method and device for ultrasonic image
JP2519779B2 (en) 3D image display device
JP2023057859A (en) Image processing device, image processing method, and program
CN114998150A (en) Three-dimensional reconstruction method and device of ultrasonic image
JPH04363775A (en) Method for three-dimensional display at high speed

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20180320

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20180320

A975 Report on accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A971005

Effective date: 20180709

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180709

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180814

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20181015

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20181030

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20181112

R150 Certificate of patent or registration of utility model

Ref document number: 6443574

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150