Brain scan positioning method and device, electronic equipment and computer storage medium
Patent Information
- Application Number
- CN202510521302.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2045-04-24
AI Technical Summary
由于人工摆位精度有限,引入的人为误差难以精确校正,现有技术存在颅脑扫描定位精度不高的问题
[0056]上述颅脑扫描定位方法、装置、电子设备及计算机存储介质,将预处理后的颅脑扫描图像输入至第一语义分割模型,获得第一颅脑分割图像;将第一颅脑分割图像和颅脑模板图像输入至颅脑配准模型,得到配准变换参数;根据配准变换参数确定患者颅脑方向,基于患者颅脑方向调整颅脑扫描设备的扫描方向。整个颅脑扫描定位过程,通过对预处理后的颅脑扫描图像进行语义分割,能够准确地识别颅脑扫描图像中的感兴趣区域,缩小配准范围,提升后续配准的准确性。通过对第一颅脑分割图像和颅脑模板图像执行配准,得到配准变换参数,能够找到使第一颅脑分割图像与颅脑模板图像对齐的空间变换方式,从而基于这一空间变换方式确定患者颅脑方向,并基于患者颅脑方向精确调整颅脑扫描设备的扫描方向。采用上述方案无需在进行颅脑扫描时对患者进行人工摆位,只需保证患者头部处于扫描床上的划定区域内,颅脑扫描设备即可根据患者的颅脑方向实现自动定位,减少了人工摆位引入的误差,提升了颅脑扫描定位的准确性。
Smart Images

Figure CN120604995B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus, electronic device, and computer storage medium for brain scanning and localization. Background Technology
[0002] With the continuous improvement of medical standards, imaging diagnostic technology is increasingly widely used in disease diagnosis and treatment. Magnetic Resonance Imaging (MRI), also known as nuclear magnetic resonance imaging, has significant advantages in the diagnosis of craniocerebral diseases due to its high tissue contrast and ability to image in any direction, and is now widely used in the clinical diagnosis and treatment of craniocerebral related diseases.
[0003] Traditional MRI brain scans rely on manual positioning, requiring technicians to locate landmarks (such as the corpus callosum) based on the initial scan images. The patient's position is then repeatedly adjusted according to the landmarks' orientation, and the MRI equipment's scanning parameters are manually adjusted for brain localization. Due to the limited precision of manual positioning and the difficulty in accurately correcting human error, current technology suffers from low accuracy in brain scan localization. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, and computer storage medium for brain scanning localization, which can improve the accuracy of brain scanning localization.
[0005] In a first aspect, embodiments of this application provide a method for localizing brain scans, including:
[0006] The preprocessed cranial scan image is input into the first semantic segmentation model to obtain the first cranial segmentation image;
[0007] The first segmented cranial image and the cranial template image are input into the cranial registration model to obtain the registration transformation parameters.
[0008] The patient's cranial orientation is determined based on the registration transformation parameters, and the scanning direction of the cranial scanning device is adjusted based on the patient's cranial orientation.
[0009] In one possible implementation, the cranial registration model includes an image preprocessing network and a three-stage registration network; the three-stage registration network is composed of a first-stage network, a second-stage network, and a third-stage network connected sequentially.
[0010] The first segmented cranial image and the cranial template image are input into the cranial registration model to obtain registration transformation parameters, including:
[0011] The first segmented cranial image and the cranial template image are input as registration image pairs into the cranial registration model. The resolution of the registration image pairs is cropped through an image preprocessing network to obtain the first registration image pair and the second registration image pair. The resolution of the image in the first registration image pair is smaller than the resolution of the image in the second registration image pair.
[0012] The first-stage network performs registration on the first registered image pair to obtain the first registration transformation parameters;
[0013] Based on the first registration transformation parameters, a spatial transformation is performed on the second cranial segmentation image in the second registered image pair to obtain the spatially transformed second cranial segmentation image.
[0014] The second-stage network is used to register the second cranial template image in the spatially transformed second cranial segmentation image and the second registered image pair to obtain the second registration transformation parameters.
[0015] Based on the second registration transformation parameters, a spatial transformation is performed on the first cranial segmentation image in the registered image pair to obtain a spatially transformed cranial segmentation image.
[0016] The third-stage network performs registration on the first spatially transformed cranial segmented image and the cranial template image in the registration image pair to obtain the registration transformation parameters.
[0017] In one possible implementation, the first-stage network includes a first convolutional coding layer, a first attention coding layer, a first attention decoding layer, and a first multilayer sensor head output layer connected in sequence; the second-stage network includes a second convolutional coding layer, a second attention coding layer, a second attention decoding layer, and a second multilayer sensor head output layer connected in sequence; and the third-stage network includes a third convolutional coding layer, a third attention coding layer, a third attention decoding layer, and a third multilayer sensor head output layer connected in sequence.
[0018] In one possible implementation, the training process of the cranial registration model includes:
[0019] The cranial segmentation sample image and cranial template image are input into the cranial registration model to obtain spatial transformation parameters;
[0020] Spatial transformation is performed on the brain segmentation sample images based on spatial transformation parameters to obtain the registration result images;
[0021] The loss function value between the registered image and the cranial template image is calculated using the global normalized cross-correlation loss function; and the step of inputting the cranial segmentation sample image and the cranial template image into the cranial registration model again to obtain the spatial transformation parameters is performed until the cranial registration model converges or reaches the preset number of iterations.
[0022] In one possible implementation, the patient's cranial orientation is determined based on registration transformation parameters, and the scanning orientation of the cranial scanning device is adjusted based on the patient's cranial orientation, including:
[0023] The rotation matrix and origin coordinates are determined based on the registration transformation parameters; the rotation matrix is used to determine the scanning direction of the cranial scanning device, and the origin coordinates are used to determine the specific location of the cranial scanning device.
[0024] The scanning direction of the cranial scanning device is adjusted based on the rotation matrix and the origin coordinates.
[0025] In one possible implementation, after determining the patient's cranial orientation based on registration transformation parameters and adjusting the scanning direction of the cranial scanning device based on the patient's cranial orientation, the method further includes:
[0026] The cranial scan images are resampled based on the rotation matrix and the origin coordinates;
[0027] Extract the intermediate layer axial image, intermediate layer coronal image, and intermediate layer sagittal image of the resampled cranial scan image;
[0028] Based on the intermediate layer axial images, the axial scanning range and axial scanning direction of the cranium were determined;
[0029] Based on the intermediate layer coronal images, the coronal scanning range and coronal scanning direction of the cranium were determined;
[0030] Based on the intermediate layer sagittal images, the sagittal scanning range and direction of the cranial scan were determined.
[0031] In one possible implementation, the axial scanning range and axial scanning direction of the cranial scan are determined based on intermediate layer axial images, including:
[0032] The first semantic segmentation model is used to obtain the cranial region in the intermediate layer axial image;
[0033] Based on the cranial region, the first key point in the intermediate layer axial image was determined;
[0034] Determine the axis scanning range based on the first key point;
[0035] The intermediate layer axial image is input into the first target detection model to obtain the second key point in the intermediate layer axial image;
[0036] The axis scanning direction is determined based on the second key point.
[0037] In one possible implementation, the coronal scanning range and direction of the cranial scan are determined based on intermediate coronal images, including:
[0038] The first semantic segmentation model is used to obtain the cranial region in the intermediate coronal image;
[0039] Based on the brain region, the third key point in the intermediate coronal image was determined;
[0040] Determine the coronal scan range based on the third key point;
[0041] The intermediate coronal image is input into the second target detection model to obtain the fourth key point in the intermediate coronal image;
[0042] The direction of the coronal scan is determined based on the fourth key point.
[0043] In one possible implementation, the sagittal scanning range and direction of the cranial scan are determined based on the intermediate layer sagittal image, including:
[0044] The first semantic segmentation model is used to obtain the brain region in the intermediate layer sagittal image;
[0045] Based on the brain region, the fifth key point in the intermediate sagittal image was determined;
[0046] Determine the sagittal scan range based on the fifth key point;
[0047] The intermediate layer sagittal image is input into the second semantic segmentation model to obtain the scan marker region in the intermediate layer sagittal image;
[0048] Based on the scanned landmark region, the sixth key point in the intermediate layer sagittal image was determined;
[0049] The sagittal scanning direction is determined based on the sixth key point.
[0050] Secondly, embodiments of this application provide a cranial scanning and localization device, comprising:
[0051] The image segmentation module is used to input the preprocessed cranial scan image into the first semantic segmentation model to obtain the first cranial segmentation image;
[0052] The image registration module is used to input the first segmented cranial image and the cranial template image into the cranial registration model to obtain the registration transformation parameters;
[0053] The scanning and positioning module is used to determine the orientation of the patient's brain based on the registration transformation parameters, and to adjust the scanning direction of the brain scanning device based on the orientation of the patient's brain.
[0054] Thirdly, embodiments of this application provide an electronic device, including: a processor and a memory; wherein the memory stores a computer program, the computer program being adapted to be loaded by the processor and executed by the method steps provided in the first aspect of embodiments of this application.
[0055] Fourthly, embodiments of this application provide a computer storage medium storing multiple instructions adapted for loading and executing the method steps provided in the first aspect of embodiments of this application by a processor.
[0056] The aforementioned cranial scanning localization method, device, electronic equipment, and computer storage medium input the preprocessed cranial scanning image into a first semantic segmentation model to obtain a first cranial segmentation image; input the first cranial segmentation image and a cranial template image into a cranial registration model to obtain registration transformation parameters; determine the patient's cranial orientation based on the registration transformation parameters; and adjust the scanning direction of the cranial scanning device based on the patient's cranial orientation. Throughout the cranial scanning localization process, semantic segmentation of the preprocessed cranial scanning image accurately identifies the region of interest in the cranial scanning image, narrows the registration range, and improves the accuracy of subsequent registration. By performing registration on the first cranial segmentation image and the cranial template image to obtain registration transformation parameters, a spatial transformation method that aligns the first cranial segmentation image with the cranial template image can be found. Based on this spatial transformation method, the patient's cranial orientation is determined, and the scanning direction of the cranial scanning device is precisely adjusted based on the patient's cranial orientation. The above method eliminates the need for manual positioning of the patient during cranial scanning. Simply ensure that the patient's head is within the designated area on the scanning bed, and the cranial scanning equipment can automatically locate the patient based on the direction of the brain. This reduces errors introduced by manual positioning and improves the accuracy of cranial scanning positioning. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 A schematic diagram illustrating the application environment of a cranial scanning localization method provided as an exemplary embodiment of this application;
[0059] Figure 2 A flowchart illustrating a cranial scanning localization method provided as an exemplary embodiment of this application;
[0060] Figure 3 A schematic diagram of a preprocessed cranial scan image provided for an exemplary embodiment of this application;
[0061] Figure 4 A schematic diagram of a first cranial segmentation image provided for an exemplary embodiment of this application;
[0062] Figure 5 A schematic diagram of a cranial template image provided for an exemplary embodiment of this application;
[0063] Figure 6 A schematic diagram of a registration result image provided for an exemplary embodiment of this application;
[0064] Figure 7 A flowchart illustrating another cranial scanning localization method provided as an exemplary embodiment of this application;
[0065] Figure 8 A schematic diagram of the architecture of a three-stage registration network provided for an exemplary embodiment of this application;
[0066] Figure 9 A schematic diagram of a resampled cranial scan image provided for an exemplary embodiment of this application;
[0067] Figure 10 A schematic diagram of an intermediate layer axial image provided for an exemplary embodiment of this application;
[0068] Figure 11 A schematic diagram of an intermediate coronal image provided for an exemplary embodiment of this application;
[0069] Figure 12 A schematic diagram of an intermediate layer sagittal image provided for an exemplary embodiment of this application;
[0070] Figure 13 A schematic diagram of the structure of a cranial scanning positioning device provided for an exemplary embodiment of this application;
[0071] Figure 14 This is a schematic diagram of the structure of an electronic device provided as an exemplary embodiment of this application. Detailed Implementation
[0072] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0073] In the description of this application, it should be understood that the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances. Furthermore, in the description of this application, unless otherwise stated, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.
[0074] In the accompanying drawings of this application, it should be understood that the labels “A,” “P,” “L,” “R,” “S,” and “I” in the medical imaging images (Figure-Figure) are all used to indicate different anatomical directions. Specifically, “A” indicates the direction pointing towards the anterior side of the body; “P” indicates the direction pointing towards the posterior side of the body; “L” indicates the direction pointing towards the left side of the body; “R” indicates the direction pointing towards the right side of the body; “S” indicates the direction pointing towards the superior side of the body; and “I” indicates the direction pointing towards the inferior side of the body.
[0075] The cranial scanning localization method provided in this application embodiment can be applied to, for example... Figure 1 The application environment shown depicts server 10 and terminal 20 communicating via a network. A data storage system can store the data that server 10 needs to process. The data storage system can be integrated onto server 10 or located in the cloud or on another network server.
[0076] In some possible embodiments, the cranial scanning localization method provided in this application can be jointly executed by server 10 and terminal 20. For example, the step of "inputting the preprocessed cranial scanning image into the first semantic segmentation model to obtain the first cranial segmentation image" can be executed by terminal 20, while the remaining steps can be executed by server 10. Correspondingly, the cranial scanning localization device can also be respectively set in server 10 and terminal 20.
[0077] In some possible embodiments, the cranial scanning localization method provided in this application can be executed by server 10. Accordingly, the cranial scanning localization device can also be disposed in server 10.
[0078] In some possible embodiments, the cranial scanning localization method provided in this application can be executed by terminal 20. Accordingly, the cranial scanning localization device can also be disposed in terminal 20.
[0079] It is worth noting that server 10 can be implemented using a standalone server or a server cluster consisting of multiple servers. Terminal 20 can be, but is not limited to, various medical imaging devices used for cranial scanning, such as MRI scanners.
[0080] In one embodiment, such as Figure 2 As shown, a cranial scanning localization method is provided. The method described in this embodiment includes the following steps:
[0081] S201: Input the preprocessed cranial scan image into the first semantic segmentation model to obtain the first cranial segmentation image.
[0082] Optionally, after ensuring that the patient's head is within the defined area on the scanning bed, a three-dimensional cranial scan image for cranial scanning localization is first acquired using a cranial scanning device. Then, image processing software or a library is used to preprocess the three-dimensional cranial scan image, such as resampling, resolution cropping, and normalization. Finally, the preprocessed three-dimensional cranial scan image is input into the first semantic segmentation model to obtain the first cranial segmentation image.
[0083] Specifically, firstly, three-dimensional cranial scan images for localization are acquired using MRI equipment. Then, image processing software and / or image processing libraries are used for the following preprocessing: the pixel spacing of the three-dimensional cranial scan images is resampled to be isotropic, ensuring consistent pixel spacing across all three dimensions; the resolution of the three-dimensional cranial scan images is cropped based on the central region to reduce and unify the size of subsequent image processing; and each pixel value in the three-dimensional cranial scan images is normalized using a normalization formula to ensure the pixel values are distributed within a standardized range. Finally, the preprocessed cranial scan images are input into the trained nnUNet first semantic segmentation model for inference, resulting in discrete label mask images. Further post-processing, such as foreground feature enhancement, is performed on the label mask images to obtain the first cranial segmentation image. This first cranial segmentation image retains the cranial region from the original three-dimensional cranial scan image while removing the background region outside the cranial region. This effectively reduces background noise interference, which not only speeds up subsequent image processing but also allows subsequent registration to focus more on the cranial region, thereby improving the accuracy of subsequent registration.
[0084] For example, in this embodiment, the pixel spacing of the original 144*144*120 resolution three-dimensional cranial scan image is resampled to 2 mm*2 mm*2 mm, the resolution is cropped to 128*128*128, and z-score normalization is performed to obtain the preprocessed cranial scan image as shown below. Figure 3 As shown. Please see below. Figure 3The image, from left to right, shows the axial, sagittal, and coronal images corresponding to the preprocessed cranial scan image. In this embodiment, the preprocessed 3D cranial scan image is input into the nnUNet first semantic segmentation model. After further post-processing, such as foreground feature enhancement, a first cranial segmentation image with a resolution of 128*128*128 is obtained, as shown below. Figure 4 As shown. Please see below. Figure 4 The image, from left to right, shows the axial, sagittal, and coronal images corresponding to the first semantic segmentation image. It can be seen that, compared to... Figure 3 The preprocessed scanned image shown is Figure 4 The first brain segmentation image shown retains only the brain region in the image, while removing the background region outside the brain region.
[0085] In this embodiment, preprocessing of the cranial scan images, including resampling, resolution cropping, and normalization, ensures consistent pixel spacing across different directions, effectively reducing and unifying the size of subsequent image processing and eliminating grayscale differences between different images, thus improving the efficiency of subsequent image processing. Semantic segmentation of the preprocessed cranial scan images accurately identifies the cranial regions within them, effectively narrowing the registration range and improving the accuracy of subsequent registration.
[0086] S202: Input the first cranial segmentation image and the cranial template image into the cranial registration model to obtain the registration transformation parameters.
[0087] The cranial template image is a reference image created according to the standard scanning direction and is used to register the first cranial segmentation image. The cranial registration model includes an image preprocessing network for resolution cropping and a three-stage registration network based on the Transformer architecture. The registration transformation parameters describe the spatial transformation required to align the first cranial segmentation image and the cranial template image.
[0088] Optionally, as Figure 4 The first cranial segmentation image shown and as follows Figure 5The shown cranial template image is input as a registration image pair into a trained cranial registration model to perform inference and obtain the parameters of the cranial registration transformation. By using the image preprocessing network in the cranial registration model, resolution cropping can be performed on the above registration image pairs to obtain the first and second registration image pairs. The resolutions of the first, second, and third registration image pairs increase sequentially. By inputting the first, second, and third registration image pairs into the first, second, and third stages of the three-stage registration network, respectively, large-angle offsets between the image to be registered (i.e., the first cranial segmented image) and the reference image (i.e., the cranial template image) can be progressively decomposed, thereby achieving more accurate and stable image registration and improving the accuracy of the registration transformation parameters.
[0089] It is worth noting that the above-mentioned cranial registration model is trained based on a custom global normalized cross-correlation (GCC) loss function. Compared with the local normalized cross-correlation (NCC) loss function used in traditional registration models, the GCC loss function can better capture the global transformation between images, reduce the registration error caused by local transformation, and thus improve the reliability of the registration transformation parameters.
[0090] For example, the registered image obtained after using the registration transformation parameters output by the above-mentioned cranial registration model is as follows: Figure 6 As shown. Please see below. Figure 6 The image, from left to right, shows the axial, sagittal, and coronal images corresponding to the registered image. It can be seen that... Figure 4 Compared to the axial and coronal images corresponding to the first segmented cranial image, Figure 6 The axial and coronal images corresponding to the registered images are more symmetrical in the left (L) and right (R) directions, respectively; Figure 4 Compared to the sagittal image corresponding to the first segmented cranial image, Figure 6 The brain region in the sagittal image corresponding to the registered image is closer to the center of the image.
[0091] In this embodiment, by inputting the first cranial segmentation image and the cranial template image into the cranial registration model for registration, accurate and reliable registration transformation parameters can be obtained. This effectively determines the spatial transformation required when aligning the first cranial segmentation image and the cranial template image, thereby clarifying the deviation between the current cranial scanning direction and the standard scanning direction, which facilitates subsequent adjustment of the scanning direction of the cranial scanning device based on this deviation.
[0092] S203: Determine the patient's cranial orientation based on the registration transformation parameters, and adjust the scanning direction of the cranial scanning device based on the patient's cranial orientation.
[0093] Understandably, in order to make the direction of the cranial scan consistent with the standard scanning direction, it is necessary to adjust the scanning direction of the cranial scan equipment without moving the patient, so that the scanning direction of the cranial scan equipment is consistent with the direction of the patient's cranium.
[0094] Optionally, the registration transformation parameters in S202 above can be represented by a 4*4 registration matrix (in this case, image registration is rigid registration), which contains rotation and translation information to represent spatial transformation. Based on the rotation and translation information contained in the registration matrix, the rotation matrix (direction) and origin coordinates of the patient's brain can be determined. Based on these two direction parameters, the DICOM (Digital Imaging and Communications in Medicine) label of the brain scanning device can be modified accordingly, thereby adjusting the scanning direction of the brain scanning device to be consistent with the direction of the patient's brain.
[0095] In this embodiment, the scanning direction of the cranial scanning device is determined by using registration transformation parameters (i.e., a 4*4 registration matrix). The scanning direction of the cranial scanning device is automatically adjusted based on the direction of the patient's cranium, which can ensure that the scanning direction of the cranial scanning device is consistent with the actual direction of the patient's cranium, reduce the error introduced by manual positioning, and improve the accuracy of cranial scanning positioning.
[0096] The aforementioned cranial scanning localization method, through preprocessing such as resampling, resolution cropping, and normalization of cranial scan images, ensures consistent pixel spacing in different directions, effectively reducing and unifying the size of subsequent image processing, eliminating grayscale differences between different images, and improving the efficiency of subsequent image processing. Semantic segmentation of the preprocessed cranial scan images accurately identifies regions of interest, narrowing the registration range and improving the accuracy of subsequent registration. By registering the first segmented cranial image and the cranial template image, registration transformation parameters are obtained, allowing for the identification of a spatial transformation method that aligns the first segmented cranial image with the cranial template image. Based on this spatial transformation method, the patient's cranial orientation is determined, and the scanning direction of the cranial scanning device is precisely adjusted accordingly. This approach eliminates the need for manual patient positioning during cranial scanning; simply ensuring the patient's head is within a designated area on the scanning table allows the cranial scanning device to automatically locate the brain based on the patient's cranial orientation, reducing errors introduced by manual positioning and improving the accuracy of cranial scanning localization.
[0097] In one embodiment, such as Figure 7 As shown, another method for localizing the brain via cranial scanning is provided. The method described in this embodiment includes the following steps:
[0098] S701: Input the preprocessed cranial scan image into the first semantic segmentation model to obtain the first cranial segmentation image.
[0099] Specifically, S701 is the same as S201, and will not be repeated here.
[0100] S702: Input the first cranial segmentation image and the cranial template image as a registration image pair into the cranial registration model, and perform resolution cropping on the registration image pair through the image preprocessing network to obtain the first registration image pair and the second registration image pair.
[0101] In this model, the first segmented cranial image and the cranial template image have the same resolution, and the resolution of the centering image of the first registered image is lower than that of the centering image of the second registered image. The cranial registration model includes an image preprocessing network and a three-stage registration network; the three-stage registration network is composed of a first-stage network, a second-stage network, and a third-stage network connected sequentially.
[0102] Optionally, both the first cranial segmentation image and the cranial template image have a resolution of 128*128*128. After inputting the first cranial segmentation image and the cranial template image as registration image pairs into the cranial registration model, the resolution of the first cranial segmentation image and the cranial template image is first cropped through an image preprocessing network to obtain a first registration image pair with a resolution of 32*32*32 and a second registration image pair with a resolution of 64*64*64.
[0103] Understandably, performing resolution cropping on the registered image pair described above is essentially reducing the size of the registered image pair. Specifically, the first registered image pair is obtained by reducing the resolution of each dimension of the registered image pair to one-quarter of its original value using an image preprocessing network, and the second registered image pair is obtained by reducing the resolution of each dimension of the registered image pair by half using the same image preprocessing network.
[0104] For ease of description, the image to be registered and the reference image contained in the first registration image pair are denoted as M1 and F1, respectively; the image to be registered and the reference image contained in the second registration image pair are denoted as M2 and F2, respectively; and the image to be registered (i.e., the first cranial segmentation image) and the reference image (i.e., the cranial template image) contained in the registration image pair are denoted as M3 and F3, respectively.
[0105] S703: The first registration image pair is registered through the first-stage network to obtain the first registration transformation parameters.
[0106] Optionally, after obtaining the first and second registered image pairs through the image preprocessing network, the first registered image pair with lower resolution is registered through the first stage network in the three-stage registration network to obtain the first registration transformation parameters (denoted as A1) for preliminary alignment of the above-mentioned registered image pairs.
[0107] For example, please see Figure 8 This is a schematic diagram of the architecture of a three-stage registration network. The first stage network includes a convolutional coding layer, a first attention coding (Transformer Encoder) layer, a first attention decoding (Transformer Decoder) layer, and a first multilayer perceptron head (MLP Head) output layer connected sequentially. After the first registered image pair is input into the first stage network, the first convolutional coding layer first performs preliminary encoding on the input M1 and F1, extracting the corresponding feature maps M1′ and F1′ for M1 and F1 respectively. Then, positional encoding is performed on M1 and F1, extracting the corresponding feature maps M1″ and F1″ for M1 and F1 respectively. Next, M1′ and M1″ are added pixel-by-pixel to obtain M1″′ containing positional information. Similarly, F1′ and F1″ are added pixel-by-pixel to obtain F1″′ containing positional information. Assuming the first convolutional coding layer has 256 channels, the dimensions of M1″′ and F1″′ are 16*16*16*256. Next, M1″′ and F1″′ are input into the first attention encoding layer for encoding, resulting in M1″″ and F1″″, each with a size of 32*32*32*256. M1″″ and F1″″ are then input into the first attention decoding layer for decoding. The two one-dimensional features obtained after decoding are input into the first multilayer sensor head to obtain the first registration transformation parameter A1.
[0108] S704: Perform a spatial transformation on the second cranial segmentation image in the second registered image pair based on the first registration transformation parameters to obtain the spatially transformed second cranial segmentation image.
[0109] Optionally, the first registration transformation parameter A1 output by the first stage network is used to perform a spatial transformation on the second cranial segmentation image M2 in the second registered image pair to transform M2 to a position closer to F2, thereby reducing the large angular offset between M2 and F2.
[0110] S705: The second-stage network performs registration on the second cranial segmentation image after spatial transformation and the second cranial template image in the second registration image pair to obtain the second registration transformation parameters.
[0111] Optionally, after performing a spatial transformation on M2, the spatially transformed M2 (denoted as M2) is then processed through the second-stage network of the three-stage registration network. Registration is performed using F2 to obtain a second registration transformation parameter (denoted as A2) for further aligning the above-mentioned registered image pairs.
[0112] For example, please see Figure 8 The second-stage network comprises a second convolutional coding layer, a second attention coding layer, a second attention decoding layer, and a second multilayer perceptron head output layer connected in sequence. After F2 is input into the second-stage network, it first passes through the second convolutional coding layer to process the input. Perform preliminary encoding with F2 and extract The feature maps corresponding to F2 and F2 respectively and F2′, and against Position encoding is performed with F2 to extract The feature maps corresponding to F2 and F2 respectively And F2″. Then and Perform pixel-by-pixel addition to obtain the result containing location information. Add F2′ and F2″ pixel by pixel to obtain F2″′ containing positional information. Assuming the second convolutional coding layer has 256 channels, the dimensions of M2″′ and F2″′ are 32*32*32*256. Then... Adding F2″′ to M1″″ and F1″″ pixel by pixel yields a result of 32*32*32*256 pixels. And F2″″, will The inputs F2″″ are fed into the second attention encoding layer for encoding, resulting in images of size 64*64*64*256. And F2″″′. Finally, The two one-dimensional features obtained after decoding are input to the second attention decoding layer and then input to the second multilayer sensor head to obtain the second registration transformation parameter A2.
[0113] S706: Perform spatial transformation on the first cranial segmentation image in the registered image pair based on the second registration transformation parameters to obtain the spatially transformed cranial segmentation image.
[0114] Optionally, the second registration transformation parameter A2 output by the second-stage network is used to perform a spatial transformation on the first cranial segmentation image M3 in the registered image pair to transform M3 to a position closer to F3, thereby reducing the large-angle offset between M3 and F3.
[0115] S707: The third-stage network performs registration on the first spatially transformed cranial segmented image and the cranial template image in the registration image pair to obtain the registration transformation parameters.
[0116] Optionally, after performing a spatial transformation on M3, the spatially transformed M3 (denoted as M3) is then processed through the third-stage network of the three-stage registration network. Registration is performed using F3 to obtain the registration transformation parameters (denoted as A3) used for the final alignment of the above registered image pairs.
[0117] For example, please see Figure 8 The third-stage network consists of a third convolutional coding layer, a third attention coding layer, a third attention decoding layer, and a third multilayer perceptron head output layer connected in sequence. After the F3 input is fed into the third-stage network, it is first processed through the third convolutional coding layer. Perform preliminary encoding with F3 to extract The feature maps corresponding to F3 and F3 respectively and F3′, and against Position encoding is performed with F3 to extract The feature maps corresponding to F3 and F3 respectively And F3″. Then and Perform pixel-by-pixel addition to obtain the result containing location information. Add F3′ and F3″ pixel-by-pixel to obtain F3″′ containing positional information. Assuming the third convolutional coding layer has 256 channels, the dimensions of M3″′ and F3″′ are 64*64*64*256. Then... F3″ and F3″ respectively Adding F2″″′ pixel by pixel yields images with dimensions of 64*64*64*256. And F3″″, will The two feature maps obtained after encoding are input into the third attention encoding layer and then into the third attention decoding layer for decoding. The two one-dimensional features obtained after decoding are input into the third multilayer sensor head to obtain the registration transformation parameter A3.
[0118] In this embodiment, the image preprocessing network and three-stage registration network included in the cranial registration model are used to register the image pairs consisting of the first cranial segmentation image and the cranial template image. The image preprocessing network performs resolution cropping on the registered image pairs, resulting in a first and second registered image pair with lower resolution. The three-stage registration network progressively decomposes the large-angle offset between the first cranial segmentation image and the cranial template image based on the first, second, and third registered image pairs, to perform more accurate and stable registration of the first cranial template image. Furthermore, the cranial registration model, running on a system equipped with an NVIDIA GeForce RTX 3060 GPU, can quickly and efficiently complete the registration task between the first cranial segmentation image and the cranial template image, with the entire registration process taking only about 0.1 seconds. Using this method, not only can the accuracy of cranial scan localization be improved, but the speed of cranial scan localization can also be significantly increased.
[0119] In one embodiment, the training process of the cranial registration model includes: inputting a cranial segmentation sample image and a cranial template image into the cranial registration model to obtain spatial transformation parameters; performing a spatial transformation on the cranial segmentation sample image based on the spatial transformation parameters to obtain a registration result image; calculating the loss function value between the registration result image and the cranial template image using a globally normalized cross-correlation loss function; and repeating the step of inputting the cranial segmentation sample image and the cranial template image into the cranial registration model to obtain spatial transformation parameters, until the cranial registration model converges or reaches a preset number of iterations.
[0120] Optionally, to make it easier for the cranial registration model to learn the large-angle global transformation between the image to be registered and the reference image, a custom Global Correlation Coefficient (GCC) loss function is used instead of the commonly used Local Normalized Cross Correlation (NCC) loss function in registration models. The formula for calculating the GCC loss function is as follows:
[0121]
[0122] Where I1(x) is the gray value of a pixel in the cranial template image, μ1 is the average pixel value in the cranial template image, I2(x) is the gray value of a pixel in the registration result image, μ2 is the average pixel value in the registration result image, and ∑ x This represents the summation of the grayscale values of all pixels in the image.
[0123] Understandably, the training process of the cranial registration model is an iterative process. During the training of the cranial registration model, the model parameters are continuously adjusted to minimize the GCC loss function value between the registered image and the cranial template image until the model converges or reaches the preset number of iterations. This allows the model to learn how to more accurately register the cranial segmentation sample image and the cranial template image.
[0124] In this embodiment, by using the GCC loss function to calculate the global correlation between the brain template image and the registration result image, the brain registration model can more easily learn the global large-angle transformation between the image to be registered and the reference image, thereby improving the accuracy and reliability of image registration.
[0125] S708: Determine the rotation matrix and origin coordinates based on the registration transformation parameters.
[0126] The rotation matrix is used to determine the scanning direction of the cranial scanning device, and the origin coordinates are used to determine the specific location of the cranial scanning device.
[0127] Optionally, the registration transformation parameter A3 can be represented by a 4*4 registration matrix (in this case, the image registration performed in the cranial registration model is rigid registration). This registration matrix includes a 3*3 rotation submatrix and a 3*1 translation submatrix. The rotation submatrix describes the rotation transformation between images, and the translation submatrix describes the translation transformation between images. Based on the rotation submatrix, the rotation matrix (direction) of the patient's cranial orientation can be determined, which can be used to determine the scanning direction of the cranial scanning device. Based on the translation submatrix, the origin coordinates of the patient's cranial orientation can be determined, and these origin coordinates can be used to determine the specific location of the cranial scanning device.
[0128] S709: Adjusts the scanning direction of the cranial scanning device based on the rotation matrix and origin coordinates.
[0129] Optionally, based on the two directional parameters of rotation matrix and origin coordinates, the DICOM tag of the cranial scanning device can be modified accordingly. According to the modified DICOM tag, the cranial scanning device can automatically adjust the scanning direction so that the adjusted scanning direction is consistent with the direction of the patient's cranium.
[0130] In this embodiment, by determining the rotation matrix and origin coordinates, the scanning direction and specific position of the cranial scanning device can be accurately adjusted, thereby ensuring that the scanning direction is consistent with the direction of the patient's brain and improving the accuracy of cranial scanning. Simultaneously, the above process requires no manual intervention; the DICOM label of the cranial scanning device that needs to be changed can be automatically determined directly using the registration transformation parameters output by the cranial registration model. This reduces the time required for manual adjustments, simplifies the cranial scanning localization process, and improves the efficiency of cranial scanning localization.
[0131] S710: Resample the cranial scan image based on the rotation matrix and the origin coordinates.
[0132] For example, the original three-dimensional cranial scan image is resampled based on the rotation matrix and the origin coordinates to obtain the resampled cranial scan image, as shown below. Figure 9 As shown. Please see below. Figure 9 The image shows, from left to right, the axial, sagittal, and coronal images corresponding to the resampled cranial scan. Since the resampled cranial scan images correspond to the actual orientation and position of the patient's brain, it can be seen that... Figure 9 The axial and coronal images of the resampled cranial scans are relatively symmetrical in the left (L) and right (R) directions. Figure 9 The brain region in the sagittal image corresponding to the resampled brain scan image is located at the center of the image.
[0133] It is worth noting that this step does not change the resolution of the brain scan image when resampling. That is, if the resolution of the original brain scan image is 144*144*120, the resolution of the resampled brain scan image will still be 144*144*120.
[0134] S711: Extract the intermediate layer axial image, intermediate layer coronal image, and intermediate layer sagittal image from the resampled cranial scan image.
[0135] Optionally, in order to further determine the direction and extent of brain scans in different orientations, intermediate MPR (Multi-Planar Reconstruction) images are extracted from the resampled brain scan images, including intermediate axial images, intermediate coronal images, and intermediate sagittal images.
[0136] S712: Based on intermediate layer axial images, determine the axial scanning range and axial scanning direction of cranial scans.
[0137] Optionally, based on the intermediate layer axial images, the axial scanning range of the cranial scan is determined using the nnUNet semantic segmentation model, and the axial scanning direction of the cranial scan is determined using the YOLOv8 object detection model. After determining the axial scanning range and direction of the cranial scan, these parameters can be saved to the cranial scanning device, thereby significantly improving the accuracy and efficiency of subsequent axial scanning of the patient's cranium.
[0138] In one embodiment, determining the axial scanning range and axial scanning direction of a cranial scan based on an intermediate layer axial image includes: obtaining a cranial region in the intermediate layer axial image using a first semantic segmentation model; determining a first key point in the intermediate layer axial image based on the cranial region; determining the axial scanning range based on the first key point; inputting the intermediate layer axial image into a first target detection model to obtain a second key point in the intermediate layer axial image; and determining the axial scanning direction based on the second key point.
[0139] The first semantic segmentation model may be, but is not limited to, the nnUNet semantic segmentation model; the first object detection model may be, but is not limited to, the YOLOv8 object detection model.
[0140] Specifically, the segmentation results output by the nnUNet semantic segmentation model in S701 can be used to directly extract the brain region from the intermediate axial image of the segmented 3D brain image. Alternatively, the 2D intermediate axial image can be input into a new nnUNet semantic segmentation model to identify the brain region in the intermediate axial image. This application does not limit the method for obtaining the brain region in the intermediate axial image. After obtaining the brain region in the intermediate axial image, the edge points of the brain region in the intermediate brain image are used as the first key points, and the axial scanning range can be determined based on the first key points. Furthermore, the YOLOv8 object detection model is used to perform object detection on the intermediate axial image to obtain two vertices in the anterior-posterior direction of the brain. These two vertices are used as the second key points, and the axial scanning direction can be determined based on the second key points.
[0141] For example, please see Figure 10 This is the intermediate layer axial image selected in this embodiment. For example... Figure 10 As shown, the cranial region in the above intermediate layer axial image is a rectangular region with points 1 and 2 as vertices. The first key point includes the two edge points of the cranial region, points 1 and 2, and the second key point includes the two vertices of the cranial region, points 3 and 4, in the anterior-posterior direction.
[0142] In this embodiment, by running the semantic segmentation model and the object detection model on a system equipped with an NVIDIA GeForce RTX 3060 GPU, key points in the intermediate layer axial images can be accurately and quickly obtained, realizing automated processing and ensuring the accuracy and efficiency of cranial scanning localization in the axial direction.
[0143] S713: Based on the intermediate layer coronal images, determine the coronal scanning range and coronal scanning direction of the cranium.
[0144] Optionally, based on the intermediate coronal images, the coronal scanning range of the cranial scan is determined using the nnUNet semantic segmentation model, and the coronal scanning direction of the cranial scan is determined using the YOLOv8 object detection model. After determining the coronal scanning range and direction of the cranial scan, these parameters can be saved to the cranial scanning device, thereby significantly improving the accuracy and efficiency of subsequent coronal scanning of the patient's cranium.
[0145] In one embodiment, determining the coronal scanning range and direction of a cranial scan based on an intermediate coronal image includes: obtaining a cranial region in the intermediate coronal image using a first semantic segmentation model; determining a third key point in the intermediate coronal image based on the cranial region; determining the coronal scanning range based on the third key point; inputting the intermediate coronal image into a second target detection model to obtain a fourth key point in the intermediate coronal image; and determining the coronal scanning direction based on the fourth key point.
[0146] The first semantic segmentation model can be, but is not limited to, the nnUNet semantic segmentation model; the second object detection model can be, but is not limited to, the YOLOv8 object detection model.
[0147] Specifically, the segmentation results output by the nnUNet semantic segmentation model in S701 can be used to directly extract the brain region from the intermediate coronal image of the segmented 3D brain image. Alternatively, the 2D intermediate coronal image can be input into a new nnUNet semantic segmentation model to identify the brain region in the intermediate coronal image. This application does not limit the method for obtaining the brain region in the intermediate coronal image. After obtaining the brain region in the intermediate coronal image, the edge points of the brain region in the intermediate brain image are used as the third key points. The coronal scanning range can be determined based on the third key points. Furthermore, the YOLOv8 object detection model is used to perform object detection on the intermediate coronal image to obtain two vertices in the vertical direction of the brain. These two vertices are used as the fourth key points. The coronal scanning direction can be determined based on the fourth key points.
[0148] For example, please see Figure 11 This is the intermediate coronal image selected in this embodiment. For example... Figure 11 As shown, the cranial region in the above intermediate coronal image is a rectangular region with points 5 and 6 as vertices. The above third key point includes the two edge points of the cranial region, points 5 and 6. The above fourth key point includes the two vertices of the cranium in the upper (S) and lower (I) directions, points 7 and 8.
[0149] In this embodiment, by running the semantic segmentation model and the object detection model on a system equipped with an NVIDIA GeForce RTX 3060 GPU, key points in the intermediate coronal images can be accurately and quickly obtained, realizing automated processing and ensuring the accuracy and efficiency of cranial scanning localization in the coronal direction.
[0150] S714: Based on the intermediate layer sagittal images, determine the sagittal scanning range and direction of the cranial scan.
[0151] Optionally, based on the intermediate layer sagittal images, the sagittal scanning range of the cranial scan is determined using the nnUNet semantic segmentation model, and the sagittal scanning direction of the cranial scan is determined using the ResUNet semantic segmentation model. After determining the sagittal scanning range and direction of the cranial scan, these parameters can be saved to the cranial scanning device, thereby significantly improving the accuracy and efficiency of subsequent sagittal scans of the patient's cranium.
[0152] In one embodiment, determining the sagittal scanning range and direction of a cranial scan based on an intermediate layer sagittal image includes: obtaining the cranial region in the intermediate layer sagittal image using a first semantic segmentation model; determining a fifth key point in the intermediate layer sagittal image based on the cranial region; determining the sagittal scanning range based on the fifth key point; inputting the intermediate layer sagittal image into a second semantic segmentation model to obtain a scanning landmark region in the intermediate layer sagittal image; determining a sixth key point in the intermediate layer sagittal image based on the scanning landmark region; and determining the sagittal scanning direction based on the sixth key point.
[0153] The first semantic segmentation model may be, but is not limited to, the nnUNet semantic segmentation model; the second semantic segmentation model may be, but is not limited to, the ResUNet semantic segmentation model; and the scan marker region may be, but is not limited to, the region where the corpus callosum is located in the intermediate layer sagittal image.
[0154] Specifically, the segmentation results output by the nnUNet semantic segmentation model in S701 can be used to directly extract the brain regions from the intermediate sagittal images of the segmented 3D brain images. Alternatively, the 2D intermediate sagittal images can be input into a new nnUNet semantic segmentation model to identify the brain regions in the intermediate sagittal images. This application does not limit the method for obtaining the brain regions in the intermediate sagittal images. After obtaining the brain regions in the intermediate sagittal images, the edge points of the brain regions in the intermediate brain images are used as the fifth key points. The sagittal scanning range can be determined based on the fifth key points.
[0155] Understandably, the corpus callosum, as the largest bundle of fibers connecting the two hemispheres of the brain, occupies a prominent position in the brain and is an important component. Its unique anatomical location and morphology make it very prominent and easily identifiable in sagittal images. Therefore, this application uses the corpus callosum as a scanning marker to determine the sagittal scanning direction of the cranial scan. Specifically, the intermediate layer sagittal image is input into the ResUNet semantic segmentation model to identify the corpus callosum as a scanning marker in the intermediate layer sagittal image, and the corpus callosum region is used as the scanning marker region. Then, based on the scanning marker region, the two vertices of the corpus callosum in the anterior-posterior direction in the intermediate layer sagittal image are obtained. These two vertices are used as the sixth keypoint, and the sagittal scanning direction is determined based on the sixth keypoint.
[0156] For example, please see Figure 12 The image shown is the intermediate sagittal image selected in this embodiment. The cranial region in the aforementioned intermediate sagittal image is a rectangular region with points 9 and 10 as vertices. The aforementioned fifth key point includes the edge points of the two cranial regions, points 9 and 10. In... Figure 12 In the intermediate sagittal image shown, the corpus callosum appears as a relatively distinct white area, its shape resembling a horizontally placed letter "C". The aforementioned sixth key point includes points 11 and 12, the two vertices of the corpus callosum in the anterior (illustrated as "A") and posterior (illustrated as "P") directions.
[0157] In this embodiment, by running the semantic segmentation model on a system equipped with an NVIDIA GeForce RTX 3060 GPU, key points in the intermediate sagittal images can be accurately and quickly obtained, achieving automated processing and ensuring the accuracy and efficiency of cranial scanning localization in the sagittal direction.
[0158] It is worth noting that this embodiment only describes a preferred implementation of this application. The actual extracted MPR intermediate layer images are not limited to the three orientations of intermediate layer axial, intermediate layer coronal, and intermediate layer sagittal images. They can also be intermediate layer oblique axial, intermediate layer oblique coronal, and intermediate layer oblique sagittal images. Correspondingly, the corresponding cranial scanning direction and cranial scanning range can be calculated based on the intermediate layer images from other orientations, and the determined scanning range and scanning direction can be classified and saved to the cranial scanning device according to different orientations. This embodiment of the application does not limit this.
[0159] In this embodiment, the image preprocessing network and three-stage registration network included in the cranial registration model progressively decompose the large-angle offset between the first cranial segmentation image and the cranial template image, enabling more accurate and stable registration of the first cranial template image. The rotation matrix and origin coordinates corresponding to the patient's cranial orientation are determined by the registration transformation parameters output by the cranial registration model, allowing for corresponding modification of the DICOM label on the cranial scanning device, enabling the device to automatically adjust its scanning direction. Based on the rotation matrix and origin coordinates, the original cranial scan image is resampled, and intermediate layer scan images from different orientations are extracted from the resampled images, allowing for the determination of the scanning range and direction for each orientation. Furthermore, the above processing, running on a system equipped with an NVIDIA GeForce RTX 3060 GPU, takes only 0.5 seconds for the entire cranial scan localization. This approach reduces human error introduced by manual intervention, simplifies the operation process, and improves the accuracy and efficiency of cranial scan localization.
[0160] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0161] Based on the above-mentioned brain scanning localization method, such as Figure 13 As shown, this application embodiment also provides a cranial scanning localization device 130 for implementing the cranial scanning localization method described above. The cranial scanning localization device 130 includes:
[0162] Image segmentation module 131 inputs the preprocessed cranial scan image into the first semantic segmentation model to obtain the first cranial segmentation image;
[0163] Image registration module 132 is used to input the first cranial segmentation image and cranial template image into the cranial registration model to obtain registration transformation parameters;
[0164] The scanning positioning module 133 is used to determine the direction of the patient's brain based on the registration transformation parameters, and to adjust the scanning direction of the brain scanning device based on the direction of the patient's brain.
[0165] In one embodiment, the cranial registration model includes an image preprocessing network and a three-stage registration network; the three-stage registration network is composed of a first-stage network, a second-stage network, and a third-stage network connected sequentially; the image registration module 132 is specifically used to input the first cranial segmentation image and the cranial template image as registration image pairs into the cranial registration model, and to perform resolution cropping on the registration image pairs through the image preprocessing network to obtain a first registration image pair and a second registration image pair; the resolution of the image in the first registration image pair is lower than the resolution of the image in the second registration image pair; and the first-stage network is used to perform registration on the first registration image pair to obtain a first registration. The transformation parameters are as follows: Based on the first registration transformation parameters, a spatial transformation is performed on the second cranial segment image in the second registered image pair to obtain the spatially transformed second cranial segment image; The second-stage network is used to register the spatially transformed second cranial segment image and the second cranial template image in the second registered image pair to obtain the second registration transformation parameters; Based on the second registration transformation parameters, a spatial transformation is performed on the first cranial segment image in the registered image pair to obtain the spatially transformed cranial segment image; The third-stage network is used to register the spatially transformed first cranial segment image and the cranial template image in the registered image pair to obtain the registration transformation parameters.
[0166] In one embodiment, the first-stage network includes a first convolutional coding layer, a first attention coding layer, a first attention decoding layer, and a first multilayer sensor head output layer connected in sequence; the second-stage network includes a second convolutional coding layer, a second attention coding layer, a second attention decoding layer, and a second multilayer sensor head output layer connected in sequence; and the third-stage network includes a third convolutional coding layer, a third attention coding layer, a third attention decoding layer, and a third multilayer sensor head output layer connected in sequence.
[0167] In one embodiment, the image registration module 132 is further configured to input the cranial segmentation sample image and the cranial template image into the cranial registration model to obtain spatial transformation parameters; perform spatial transformation on the cranial segmentation sample image based on the spatial transformation parameters to obtain a registration result image; calculate the loss function value between the registration result image and the cranial template image using a globally normalized cross-correlation loss function; and repeat the step of inputting the cranial segmentation sample image and the cranial template image into the cranial registration model to obtain spatial transformation parameters until the cranial registration model converges or reaches a preset number of iterations.
[0168] In one embodiment, the scanning positioning module 133 is specifically used to determine the rotation matrix and origin coordinates according to the registration transformation parameters; the rotation matrix is used to determine the scanning direction of the cranial scanning device, and the origin coordinates are used to determine the specific position of the cranial scanning device; the scanning direction of the cranial scanning device is adjusted based on the rotation matrix and origin coordinates.
[0169] In one embodiment, the scanning positioning module 133 is further configured to resample the cranial scan image according to the rotation matrix and the origin coordinates; extract the intermediate layer axial image, intermediate layer coronal image and intermediate layer sagittal image of the resampled cranial scan image; determine the axial scanning range and axial scanning direction of the cranial scan based on the intermediate layer axial image; determine the coronal scanning range and coronal scanning direction of the cranial scan based on the intermediate layer coronal image; and determine the sagittal scanning range and sagittal scanning direction of the cranial scan based on the intermediate layer sagittal image.
[0170] In one embodiment, the scanning and localization module 133 is specifically used to obtain the cranial region in the intermediate layer axial image through a first semantic segmentation model; determine the first key point in the intermediate layer axial image based on the cranial region; determine the axial scanning range according to the first key point; input the intermediate layer axial image into a first target detection model to obtain the second key point in the intermediate layer axial image; and determine the axial scanning direction according to the second key point.
[0171] In one embodiment, the scanning and localization module 133 is specifically used to obtain the brain region in the intermediate coronal image through a first semantic segmentation model; determine the third key point in the intermediate coronal image based on the brain region; determine the coronal scanning range according to the third key point; input the intermediate coronal image into a second target detection model to obtain the fourth key point in the intermediate coronal image; and determine the coronal scanning direction according to the fourth key point.
[0172] In one embodiment, the scanning localization module 133 is specifically used to obtain the cranial region in the intermediate layer sagittal image through a first semantic segmentation model; determine the fifth key point in the intermediate layer sagittal image based on the cranial region; determine the sagittal scanning range based on the fifth key point; input the intermediate layer sagittal image into a second semantic segmentation model to obtain the scanning landmark region in the intermediate layer sagittal image; determine the sixth key point in the intermediate layer sagittal image based on the scanning landmark region; and determine the sagittal scanning direction based on the sixth key point.
[0173] Each module in the aforementioned cranial scanning localization 130 can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0174] This application also provides an electronic device, which can be a server, and its internal structure diagram can be as follows: Figure 14 As shown, this electronic device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores cranial scan image data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. The processor executes computer programs to implement a cranial scan localization method.
[0175] Those skilled in the art will understand that Figure 14 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0176] This application also provides a computer-readable storage medium storing instructions that, when executed on a computer or processor, cause the computer or processor to perform one or more steps in the above embodiments. If the constituent modules of the above-described electronic device are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium.
[0177] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital versatile discs (DVDs)), or semiconductor media (e.g., solid-state drives (SSDs)).
[0178] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks. Unless otherwise specified, the technical features of this embodiment and its implementation can be combined arbitrarily.
[0179] The embodiments described above are merely preferred embodiments of this application and are not intended to limit the scope of this application. Any modifications and improvements made by those skilled in the art to the technical solutions of this application without departing from the spirit of this application should fall within the protection scope defined by the claims.
[0180] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Claims
1. A method for localizing brain scans, characterized in that, The method includes: The preprocessed cranial scan image is input into the first semantic segmentation model to obtain the first cranial segmentation image; The first segmented cranial image and the cranial template image are input into the cranial registration model to obtain the registration transformation parameters. The patient's cranial orientation is determined based on the registration transformation parameters, and the scanning direction of the cranial scanning device is adjusted based on the patient's cranial orientation. The cranial registration model includes an image preprocessing network and a three-stage registration network; the three-stage registration network is composed of a first-stage network, a second-stage network, and a third-stage network connected sequentially. The step of inputting the first segmented cranial image and the cranial template image into the cranial registration model to obtain registration transformation parameters includes: The first segmented cranial image and the cranial template image are input as a registration image pair into the cranial registration model. The image preprocessing network performs resolution cropping on the registration image pair to obtain a first registration image pair and a second registration image pair. The resolution of the image in the first registration image pair is smaller than the resolution of the image in the second registration image pair. The first registration image pair is registered using the first-stage network to obtain the first registration transformation parameters; Based on the first registration transformation parameters, a spatial transformation is performed on the second cranial segmentation image in the second registered image pair to obtain the spatially transformed second cranial segmentation image. The second-stage network performs registration on the spatially transformed second cranial segment image and the second cranial template image in the second registration image pair to obtain the second registration transformation parameters. Based on the second registration transformation parameters, a spatial transformation is performed on the first cranial segmentation image in the registered image pair to obtain the spatially transformed cranial segmentation image. The third-stage network is used to register the spatially transformed first cranial segmented image and the cranial template image in the registered image pair to obtain the registration transformation parameters. The step of determining the patient's cranial orientation based on the registration transformation parameters and adjusting the scanning direction of the cranial scanning device based on the patient's cranial orientation includes: The rotation matrix and origin coordinates are determined based on the registration transformation parameters; the rotation matrix is used to determine the scanning direction of the cranial scanning device, and the origin coordinates are used to determine the specific location of the cranial scanning device. The scanning direction of the cranial scanning device is adjusted based on the rotation matrix and the origin coordinates. The method further includes, after determining the patient's cranial orientation based on the registration transformation parameters and adjusting the scanning direction of the cranial scanning device based on the patient's cranial orientation: The cranial scan image is resampled based on the rotation matrix and the origin coordinates; Extract the intermediate layer axial image, intermediate layer coronal image, and intermediate layer sagittal image of the resampled cranial scan image; Based on the intermediate layer axial images, the axial scanning range and axial scanning direction of the cranial scan are determined; Based on the intermediate coronal images, the coronal scanning range and coronal scanning direction of the cranial scan are determined; Based on the intermediate layer sagittal image, the sagittal scanning range and sagittal scanning direction of the cranial scan are determined.
2. The method as described in claim 1, characterized in that, The first-stage network includes a first convolutional coding layer, a first attention coding layer, a first attention decoding layer, and a first multilayer sensor head output layer connected in sequence; the second-stage network includes a second convolutional coding layer, a second attention coding layer, a second attention decoding layer, and a second multilayer sensor head output layer connected in sequence; the third-stage network includes a third convolutional coding layer, a third attention coding layer, a third attention decoding layer, and a third multilayer sensor head output layer connected in sequence.
3. The method as described in claim 1, characterized in that, The training process of the cranial registration model includes: The cranial segmentation sample image and the cranial template image are input into the cranial registration model to obtain spatial transformation parameters; Based on the spatial transformation parameters, a spatial transformation is performed on the brain segmentation sample image to obtain a registration result image; The loss function value between the registration result image and the cranial template image is calculated using the global normalized cross-correlation loss function; and the step of inputting the cranial segmentation sample image and the cranial template image into the cranial registration model to obtain spatial transformation parameters is executed again until the cranial registration model converges or reaches the preset number of iterations.
4. The method as described in claim 1, characterized in that, The determination of the axial scanning range and axial scanning direction of the cranial scan based on the intermediate layer axial image includes: The cranial region in the intermediate layer axial image is obtained through the first semantic segmentation model; Based on the brain region, the first key point in the intermediate layer axial image is determined; The axis scanning range is determined based on the first key point; The intermediate layer axial image is input into the first target detection model to obtain the second key point in the intermediate layer axial image; The axis scanning direction is determined based on the second key point.
5. The method as described in claim 1, characterized in that, The step of determining the coronal scanning range and direction of the cranial scan based on the intermediate coronal image includes: The cranial region in the intermediate coronal image is obtained using the first semantic segmentation model; Based on the brain region, a third key point is determined in the intermediate coronal image; The coronal scan range is determined based on the third key point; The intermediate coronal image is input into the second target detection model to obtain the fourth key point in the intermediate coronal image; The coronal scanning direction is determined based on the fourth key point.
6. The method as described in claim 1, characterized in that, The step of determining the sagittal scanning range and direction of the cranial scan based on the intermediate layer sagittal image includes: The first semantic segmentation model is used to obtain the brain region in the intermediate layer sagittal image; Based on the brain region, the fifth key point in the intermediate layer sagittal image was determined; The sagittal scanning range is determined based on the fifth key point; The intermediate layer sagittal image is input into the second semantic segmentation model to obtain the scan marker region in the intermediate layer sagittal image; Based on the scan marker region, the sixth key point in the intermediate layer sagittal image is determined; The sagittal scanning direction is determined based on the sixth key point.
7. A cranial scanning and positioning device, characterized in that, The device includes: The image segmentation module is used to input the preprocessed cranial scan image into the first semantic segmentation model to obtain the first cranial segmentation image; The image registration module is used to input the first cranial segmentation image and the cranial template image into the cranial registration model to obtain registration transformation parameters; The scanning positioning module is used to determine the direction of the patient's brain based on the registration transformation parameters, and to adjust the scanning direction of the brain scanning device based on the direction of the patient's brain. The apparatus is used to perform the steps of the method as described in any one of claims 1-6.
8. An electronic device, characterized in that, include: Processor and memory; The memory stores a computer program, and when the processor executes the computer program, it implements the steps of the method as described in any one of claims 1-6.
9. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions adapted for loading by a processor and executing the steps of the method as described in any one of claims 1-6.
Citation Information
Patent Citations
Skull detection method and device
CN111462055A
Processing method of brain magnetic resonance diffusion weighted image and related product
CN113538348A