Brain image processing analysis method and system based on container technology
Through container technology, the calculation step code in the brain image processing process is consistent and distributed processing is carried out, which solves the problems of low efficiency and poor consistency in the existing technology, and realizes efficient and flexible brain image data analysis.
Patent Information
- Application Number
- CN202411212827.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-11-08
AI Technical Summary
When processing large-scale and complex brain image data, existing brain image processing and analysis methods are inefficient, inconsistent results and lack flexibility, making it difficult to meet clinical and scientific research needs.
Container technology is used to modify the code of each calculation step in the brain image processing process into a consistent format, compile it into an executable file, and deploy and migrate container technology, and use container orchestration tools to realize parallel processing and distributed computing.
It improves processing efficiency and consistency of results, supports large-scale data analysis, enhances the flexibility and scalability of the method, and meets the needs of clinical and scientific research.
Smart Images

Figure CN118919033A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of imaging technology, and in particular to a brain image processing and analysis method and system based on container technology. Background Art
[0002] In the current field of medical and neuroscience research, brain imaging data analysis plays a vital role. With the rapid development of computer technology and imaging technology, the amount of imaging data has exploded, and the study of multimodal brain imaging has become the norm. Especially in clinical applications such as tumor brain imaging, a large amount of multimodal brain imaging data has been accumulated. However, the processing and analysis of these data face many challenges. From the overall situation in the field of technology, the existing brain imaging processing and analysis methods mostly rely on traditional computing environments and software tools. These tools perform well when processing small-scale data, but when faced with large-scale and complex brain imaging data, their processing efficiency and accuracy often cannot meet the needs. In addition, these tools often have high requirements on the user's programming ability, which limits their wide application in clinical and scientific research fields.
[0003] The existing technology has the following defects and deficiencies in brain image processing and analysis:
[0004] Poor repeatability. Traditional brain image processing and analysis methods often rely on specific computing environments and software tools, which seriously affects the repeatability of analysis results. When the computing environment or software version is changed, the analysis results may differ. Secondly, it is difficult to store and analyze large-scale data. With the continuous growth of brain image data, the existing technology lacks effective parallel processing and distributed computing support for the processing and analysis of large-scale brain image data, resulting in low processing efficiency and unable to meet clinical and research needs. In addition, traditional brain image processing and analysis methods often lack flexibility and cannot be customized and expanded according to actual needs, which limits their application in different scenarios.
[0005] Therefore, there is an urgent need for a brain image processing and analysis method that is simple to operate and fully functional to provide computational support for brain science researchers. Summary of the invention
[0006] In view of the defects of the brain image processing and analysis methods in the prior art, the present invention provides a brain image processing and analysis method and system based on container technology. This method can realize distributed processing of brain image data, improve data processing speed, and optimize computing resources through containerization technology.
[0007] The present invention is achieved through the following technical solutions:
[0008] A brain image processing and analysis method based on container technology, characterized in that it comprises the following steps:
[0009] Step 1: based on the processing of brain image data, modify the code of each calculation step in the brain image processing process so that the input and output file directories and parameter formats of each calculation step remain consistent, and compile the modified code of each calculation step into an executable file;
[0010] Step 2: Package the compiled multiple executable files and corresponding configuration files into an independent container image, and deploy and migrate the brain image processing process to the operating system through containerization technology;
[0011] Step 3: Based on the container image, a call file for calling the corresponding steps of the image is written, and the call file is run to implement the same brain image data processing process as the brain image analysis tool.
[0012] Preferably, the brain image processing process includes: format conversion of brain image data, removal of the first n images in the brain image data, artifact correction of brain image data, standardization of brain image data, spatial smoothing of brain image data, removal of linear drift of brain image data, regression covariate processing of brain image data and at least one processing method of frequency domain filtering of brain image data.
[0013] Preferably, the modification of the code of the calculation step includes:
[0014] Get all the execution codes of the calculation step, adjust the input and output file directory format and parameter order of the outermost code to keep it consistent in the code of each calculation step.
[0015] Preferably, the compilation of the executable file includes:
[0016] A compilation tool is configured based on the current operating system and the supporting environment required for code operation, and the compilation tool is used to compile the modified code into an executable file.
[0017] Preferably, the configuration file in step 2 is a library and environment configuration file loaded by the execution file at runtime.
[0018] Preferably, the libraries include system libraries, third-party libraries, and application-specific libraries;
[0019] The environment configuration file includes system environment, operating environment and software dependencies.
[0020] Preferably, the packaging of the container image includes:
[0021] Configure the container engine based on the current operating system, write the configuration file, and package the collection of executable files and their runtime library files and environment to generate an independent container image;
[0022] Let the set of brain image calculation steps be B = {act i |i∈[1,M]}, the required input file directory set is I={input i |i∈[1,M]}, output file directory set O={output i |i∈[1,M]}, the required parameter set is P={p i |i∈[1,M]};
[0023] Build execution command Image, input i ,output i ,p i , execute the calculation step act i ∈B.
[0024] Preferably, the calling file in step 3 is a YAML file that calls the corresponding calculation step, and sets the input file directory, output file directory and parameters required for the calculation step.
[0025] Preferably, for any calculation step, a corresponding YAML file is written, the YAML file calls the container mirror and defines the input file directory, output file directory and parameters required for the calculation step;
[0026] The container orchestration tool is used to run the YAML file, and the same processing steps as those in the brain imaging analysis tool are performed on the brain imaging data in the input file directory, and the processing results are stored in the output file directory.
[0027] A system for a brain image processing and analysis method based on container technology, comprising:
[0028] An execution file module is used to modify the code of each calculation step in the brain image processing process based on the brain image processing process, so that the input and output file directories and parameter formats of each calculation step are consistent, and compile the modified code of each calculation step into an executable file;
[0029] The container image module is used to package multiple compiled executable files and corresponding configuration files into independent container images, and deploy and migrate the brain image processing process through containerization technology;
[0030] The calling module is used to write a calling file for the corresponding steps of calling the image based on the container image, run the calling file, and realize the brain image processing process.
[0031] Compared with the prior art, the present invention has the following beneficial technical effects:
[0032] Compared with the existing brain image processing and analysis methods, the present invention has the following beneficial effects:
[0033] The present invention provides a brain image processing and analysis method based on container technology. The method compiles each calculation step in the brain image processing process into an independent executable file, and uses container technology and corresponding orchestration tools to build a brain image processing and analysis environment. Container technology allows executable files and their dependencies to be packaged into a portable unit, namely a container. This enables the computing environment and software tools required for brain image processing and analysis to be consistently deployed on any compatible operating system. Since the environment and tools in the container remain unchanged, the consistency of the analysis results in different computing environments is ensured; in addition, the container orchestration tool can be used to orchestrate and manage multiple containers to achieve parallel processing and distributed computing of brain image data. By assigning tasks to multiple containers for simultaneous execution, the processing efficiency is significantly improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 is a flow chart of the brain image processing and analysis method of the present invention;
[0035] Figure 2 The figure is a flow chart of the arrangement of the YAML file of the present invention. DETAILED DESCRIPTION
[0036] The present invention will be further described in detail below in conjunction with the accompanying drawings, which are intended to explain the present invention rather than to limit it.
[0037] See also Figure 1 , a brain image processing and analysis method based on container technology, comprising the following steps:
[0038] Step 1: According to the processing process of the brain image analysis tool, the code of each calculation step in the brain image processing process is modified to make the input and output file directories and parameter formats of each calculation step consistent, and a suitable compilation tool is selected to compile the modified code of each calculation step into an executable file;
[0039] The step of calculating the brain image includes at least one of the following steps:
[0040] 1) Format conversion of brain imaging data;
[0041] 2) Remove the first n images in the brain image data; Correct the brain image data to remove artifacts caused by the different acquisition times of different slices during scanning;
[0042] 3) Head motion correction of brain imaging data, which is used to eliminate or correct image artifacts caused by the subject's head movement during scanning;
[0043] 4) Standardization of brain imaging data to make brain imaging data from different individuals or under different acquisition conditions consistent in morphology, location or characteristics;
[0044] 5) Spatial smoothing of brain imaging data to reduce image noise, improve signal-to-noise ratio, and enhance image uniformity;
[0045] 6) Delinear drift of brain imaging data, which is used to remove linear trends in time series data so that other potential changes or relationships can be analyzed more accurately; delinear drift processing is particularly critical when analyzing brain imaging data (such as fMRI, i.e. functional magnetic resonance imaging), because linear drift may be caused by a variety of factors, including but not limited to subject head movement, instrument temperature changes, and small fluctuations in the magnetic field;
[0046] 7) Regression covariate processing of brain imaging data. In the process of brain imaging processing and analysis, regression covariates may be implemented through statistical methods (such as linear regression), in which brain imaging data (such as functional connectivity, gray matter volume, etc.) are used as dependent variables, and some external factors (i.e., covariates) are used as independent variables. By performing regression analysis on these covariates, their impact on the dependent variable can be estimated and considered or removed in subsequent statistical analysis, thereby more accurately evaluating the relationship between the research variables (such as brain area activity, brain network connectivity, etc.) and the results of interest.
[0047] 8) Frequency domain filtering of brain image data, by converting the data from the time domain (or space domain) to the frequency domain (frequency domain), filtering in the frequency domain, and then converting the processed signal back to the time domain (or space domain). In brain image processing, frequency domain filtering is mainly used to remove noise, smooth images or perform feature extraction.
[0048] 9) Cleaning and denoising of brain image data.
[0049] For brain imaging data, the processing that can be used includes but is not limited to: DICOM to Nifti conversion, removal of the first n images, Slice Timing, head motion correction, standardization, spatial smoothing, removal of linear drift, regression covariates, frequency domain filtering, and Scrubbing. Let the set of computational steps of the brain imaging processing process be A = {act i |i∈[1,N]}, where N represents the number of computation steps.
[0050] According to a specific brain image analysis tool (such as SPM, FSL, etc.), the calculation steps of the brain image processing process can be sorted out and expressed as B = {act i |i∈[1,M]}, then there must be M≤N, for a specific calculation step act i∈B, filter all the codes involved in the calculation step in the brain imaging analysis tool, adjust the input and output file directory format and parameter order of the outermost code to make it consistent in the code of each calculation step. Based on the current operating system and the supporting environment required for code operation, select a suitable compilation tool to compile the adjusted code of each calculation step into an executable file. The executable file set is recorded as D = {d i |i∈[1,M]}.
[0051] Step 2: Package the compiled executable files and corresponding libraries and environments into independent container images, and deploy and migrate the brain image processing process through containerization technology;
[0052] The multiple executable files compiled in the previous step and their dependent libraries and environments are packaged into independent container images, and the rapid deployment and migration of brain imaging processing is achieved through containerization technology. This ensures that different brain imaging research teams can process and analyze data in a unified software environment, improving the consistency of results.
[0053] In the process of packaging multiple compiled executable files and their dependent libraries, environments, etc. into independent container images, the dependent libraries and environments refer to the software components and system settings that must be loaded and configured when running these executable files. These dependencies ensure that the executable files can correctly perform their intended functions in a specific environment.
[0054] Libraries include system libraries, third-party libraries, and application-specific libraries.
[0055] System library: standard library provided by the operating system, such as C standard library (libc), mathematics library (libm), etc., which are frequently called during the execution of various programming languages.
[0056] Third-party libraries: In addition to system libraries, many software also rely on libraries developed by third parties. These libraries may provide specific algorithm implementations, data structures, graphics rendering, network communication and other functions. In brain imaging processing, image processing libraries (such as OpenCV), data analysis libraries (such as NumPy, Pandas), statistical modeling libraries (such as SciPy), etc. are used.
[0057] Application-specific libraries: These libraries are designed for specific applications or fields, such as the NIfTI library commonly used in medical image processing, which is used to read and write medical image files in the NIfTI format.
[0058] The environment includes the operating system environment, the runtime environment, and software dependencies;
[0059] Operating system environment: including the operating system version, architecture (such as x86_64, ARM), etc. Container technology allows applications and their dependencies to be encapsulated in an environment isolated from the host operating system, but the environment inside the container needs to be consistent with that at compile time.
[0060] Runtime environment: For applications that require an interpreter or virtual machine to run (such as Python and Java applications), the container needs to contain the corresponding version of the interpreter or virtual machine. In addition, it also includes configurations such as environment variables and file paths, which will affect the execution of the application.
[0061] Software dependencies: In complex applications, there may be complex dependencies between components. For example, an executable file may depend on the output of another executable file or library file. When building a container image, you need to ensure that these dependencies are correctly resolved and satisfied.
[0062] The packaging process of an independent container image is to package the compiled executable file and its dependent libraries, environment, etc. into an independent container image, usually using Dockerfile or similar container build scripts.
[0063] In this embodiment, based on the current operating system, a suitable container engine is installed, a configuration file is written, and the executable file set D compiled in the previous step and its runtime dependent library files and environment are packaged to generate an independent container image Image. Since the executable file of each calculation step is encapsulated in the Image, each calculation step can be operated through the Image. Let the input file directory set required for the calculation step be I = {input i |i∈[1,M]}, output file directory set O={output i |i∈[1,M]}, the required parameter set is P={p i |i∈[1,M]}, then for a specific calculation step act i ∈B, can be executed by the following command format: Image, input i ,output i ,p i ;Through containerization technology, the rapid deployment and migration of brain imaging processing can be achieved.
[0064] Step 3: For each calculation step of the brain image processing process, based on the packaged container image, write a YAML file that calls the corresponding step of the image, and run the YAML file through the container orchestration tool to implement the brain image processing process.
[0065] YAML (Yet Another Markup Language) is an intuitive data serialization format, commonly used in configuration files. In the scenario of brain image processing and analysis, YAML files are used to describe and define containers, calculation steps, and the relationships and configurations between them. For each calculation step in the brain image processing process, you need to write a corresponding YAML file to call the corresponding container image and specify the input file directory, output file directory, and required parameters required for the calculation step. The structured expression of the YAML file makes the configuration process clear and easy to manage.
[0066] YAML files can describe and define containers, computing steps, and their relationships and configurations in a structured way. Install a suitable container orchestration tool and run the written YAML files to implement the brain imaging process.
[0067] In this embodiment, based on the current operating system, a suitable container orchestration tool is installed to schedule and run the container created by the image. i ∈B, write the corresponding YAML file. This YAML file calls the container image Image generated in the previous step and defines the calculation step sct i Required input file directory input i , output file directory output i , required parameters p i . Run the YAML file through the container orchestration tool, then you can input i Brain imaging data execution and brain imaging analysis tools in act i The same processing process, the processing results are stored in output i If you need to process multiple calculation steps continuously, use the container orchestration tool to orchestrate and run the YAML file of each calculation step. The specific workflow is as follows: Figure 2 As shown, the output file of the previous calculation step is used as the input file of the next calculation step and is processed in sequence.
[0068] In another aspect, the present invention further provides a brain image processing and analysis system based on container technology, comprising:
[0069] An execution file module is used to modify the code of each calculation step in the brain image processing process based on the brain image processing process, so that the input and output file directories and parameter formats of each calculation step are consistent, and compile the modified code of each calculation step into an executable file;
[0070] The container image module is used to package multiple compiled executable files and corresponding configuration files into independent container images, and deploy and migrate the brain image processing process through containerization technology;
[0071] The calling module is used to write a calling file for the corresponding steps of calling the image based on the container image, run the calling file, and realize the brain image processing process.
[0072] Compared with the existing brain image processing and analysis methods, the present invention has the following beneficial effects:
[0073] 1. Improve the repeatability of analysis results
[0074] The present invention uses container technology and corresponding orchestration tools to build a brain image processing and analysis environment. Container technology allows applications and their dependencies to be packaged into a portable unit, namely a container. This enables the computing environment and software tools required for brain image processing and analysis to be consistently deployed on any compatible operating system, regardless of the underlying hardware or software version. Therefore, when the computing environment or software version is changed, the environment and tools in the container remain unchanged, ensuring the consistency of the analysis results in different computing environments.
[0075] 2. Support large-scale data storage and analysis
[0076] The present invention uses container orchestration tools to orchestrate and manage multiple containers, realizing parallel processing and distributed computing of brain imaging data. By distributing tasks to multiple containers for simultaneous execution, the processing efficiency is significantly improved, meeting the needs of clinical and research for large-scale data processing. At the same time, data can be stored in multiple nodes in the network in a dispersed manner, achieving high availability, scalability and fault tolerance of data.
[0077] 3. Enhanced flexibility and scalability
[0078] The method proposed in the present invention uses container technology to build an automated brain image processing and analysis process, including steps such as data preprocessing, feature extraction, model training, and result visualization. By writing scripts and configuration files, the process can be automatically executed and monitored. The lightweight and portability of the container allows the brain image processing and analysis method to be easily customized and expanded. As research needs continue to change and technology continues to develop, brain imaging researchers can modify the container configuration or add new containers to expand the functionality of the method, and integrate tools and algorithms suitable for their own research to meet the needs of different scenarios.
[0079] In another embodiment of the present invention, a computer device is provided, the computer device including a processor and a memory, the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., which are the computing core and control core of the terminal, which are suitable for implementing one or more instructions, and are specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used for the operation of the brain image processing and analysis method based on container technology.
[0080] In another embodiment of the present invention, the present invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in a computer device and, of course, an extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the brain image processing and analysis method based on container technology in the above-mentioned embodiment.
[0081] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0082] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0083] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0084] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0085] The above contents are only for explaining the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.
Claims
1. A brain image processing and analysis method based on container technology, characterized in that: The following steps are involved: Step 1: based on the processing of brain image data, modify the code of each calculation step in the brain image processing process so that the input and output file directories and parameter formats of each calculation step remain consistent, and compile the modified code of each calculation step into an executable file; Step 2: Package the compiled multiple executable files and corresponding configuration files into an independent container image, and deploy and migrate the brain image processing process to the operating system through containerization technology; Step 3: Based on the container image, a call file for calling the corresponding steps of the image is written, and the call file is run to implement the same brain image data processing process as the brain image analysis tool.
2. According to claim 1, a brain image processing and analysis method based on container technology is characterized in that: The brain image processing process includes: format conversion of brain image data, removal of the first n images in the brain image data, artifact correction of brain image data, standardization of brain image data, spatial smoothing of brain image data, removal of linear drift of brain image data, regression covariate processing of brain image data and at least one processing method of frequency domain filtering of brain image data.
3. The brain image processing and analysis method based on container technology according to claim 1 is characterized in that: The modification of the code of the calculation step includes: Get all the execution codes of the calculation step, adjust the input and output file directory format and parameter order of the outermost code to keep it consistent in the code of each calculation step.
4. A brain image processing and analysis method based on container technology according to claim 1 or 3, characterized in that: Compilation using an executable file includes: A compilation tool is configured based on the current operating system and the supporting environment required for code operation, and the compilation tool is used to compile the modified code into an executable file.
5. The brain image processing and analysis method based on container technology according to claim 1 is characterized in that: The configuration files in step 2 are the libraries and environment configuration files that are loaded by the executable file at runtime.
6. The method for brain image processing and analysis based on container technology according to claim 5, characterized in that: The libraries include system libraries, third-party libraries, and application-specific libraries; The environment configuration file includes system environment, operating environment and software dependencies.
7. The brain image processing and analysis method based on container technology according to claim 1 is characterized in that: The packaging of the container image includes: Configure the container engine based on the current operating system, write the configuration file, and package the collection of executable files and their runtime library files and environment to generate an independent container image; Let the set of brain image calculation steps be B = {act i |i∈[1,M]}, the required input file directory set is I={input i |i∈[1,M]}, output file directory set O={output i |i∈[1,M]}, the required parameter set is P={p i |i∈[1,M]}; Build and execute command Image, input i , output i , p i , execute the calculation step act i ∈B.
8. The brain image processing and analysis method based on container technology according to claim 1 is characterized in that: The calling file in step 3 is a YAML file that calls the corresponding calculation step, and sets the input file directory, output file directory and parameters required for the calculation step.
9. The method for brain image processing and analysis based on container technology according to claim 8, characterized in that: For any calculation step, write a corresponding YAML file that calls the container mirror and defines the input file directory, output file directory, and parameters required for the calculation step; The container orchestration tool is used to run the YAML file, and the same processing steps as those in the brain imaging analysis tool are performed on the brain imaging data in the input file directory, and the processing results are stored in the output file directory.
10. A system for executing the brain image processing and analysis method based on container technology according to any one of claims 1 to 9, characterized in that: include: An execution file module is used to modify the code of each calculation step in the brain image processing process based on the brain image processing process, so that the input and output file directories and parameter formats of each calculation step are consistent, and the modified code of each calculation step is compiled into an executable file; The container image module is used to package multiple compiled executable files and corresponding configuration files into independent container images, and deploy and migrate the brain image processing process through containerization technology; The calling module is used to write a calling file for the corresponding steps of calling the image based on the container image, run the calling file, and realize the brain image processing process.
Citation Information
Cited By
Test method and test system
CN119537251A
