Method and system for automatically extracting and preprocessing Western Blot image
By constructing an automatic image extraction and preprocessing system based on the ImageJ platform, the problems of low efficiency and poor accuracy in Western Blot image analysis in existing technologies are solved. The system enables automatic image screening, copying, conversion, and background noise reduction, thereby improving processing efficiency and accuracy.
Patent Information
- Application Number
- CN202511524911.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-24
- Publication Date
- 2025-11-21
AI Technical Summary
The existing ImageJ platform is inefficient, error-prone, unable to process images in batches, lacks standardized preprocessing, and is prone to errors during image copying.
Based on the ImageJ platform, an automatic image extraction and preprocessing system is built using macro language to achieve automatic image file filtering, copying, conversion, and background noise reduction. The rolling ball background subtraction algorithm is used for image processing.
It realizes automatic batch extraction and preprocessing of Western Blot images, improves processing efficiency, ensures the accuracy and logical robustness of image processing, and avoids human operation errors.
Smart Images

Figure CN120994850A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image analysis and processing, and in particular relates to a method and system for automatic extraction and preprocessing of Western Blot images. Background Technology
[0002] Western blotting image analysis is a commonly used technique in molecular biology research. Common analytical workflows rely on the ImageJ platform, but existing ImageJ platforms have the following problems in analytical applications: (1) The existing ImageJ platform is mainly geared towards manual operation. Users need to open images one by one, select regions, and manually perform operations such as image format conversion and background noise reduction, which is inefficient and prone to errors. It is difficult to manually find and extract target images from multiple folders.
[0003] (2) The existing ImageJ platform does not support batch extraction of images. Existing methods cannot accurately filter specific image files. Researchers need to manually search for target images from multi-level folders and perform preprocessing (such as converting to 8-bit images, background noise reduction, etc.). This process is highly dependent on user experience, has poor repeatability, and is not suitable for high-throughput data processing.
[0004] (3) The image copying process of the existing ImageJ platform is prone to containing duplicate paths.
[0005] (4) The existing ImageJ platform lacks a unified standardized method for image preprocessing. Summary of the Invention
[0006] In view of the shortcomings of the prior art, the purpose of this invention is to provide a method and system for automatic extraction and preprocessing of Western blotting images, which can automatically complete image extraction, improve efficiency, avoid misoperation, and ensure the accuracy of preprocessed images.
[0007] In a first aspect, the present invention provides a method for automatic extraction and preprocessing of Western Blot images, the method being executed on the ImageJ platform and comprising the following steps: S1, Display the folder selection interface to the user, and select the input folder according to the user's instructions; S2, automatically create the target subfolder under the selected folder path; S3 recursively traverses the folders under the input path and all subfolders under the input path to query the target image files that conform to the preset field naming rules; S4: Copy or move the target image files that match the preset field naming rules to the target subfolder to automatically extract the image files; S5, traverse the files in the target subfolder, automatically skipping the output folder path to avoid recursion getting into an infinite loop; S6. After copying the image file, the image is converted to an image type and subjected to background noise reduction. The rolling ball background subtraction algorithm is used to perform background noise reduction on the converted image. S7, after processing is complete, displays a task completion message to the user.
[0008] Furthermore, in S4, the preset field naming rules include: keywords in the image file name and / or image format.
[0009] Furthermore, in S6, the image type conversion includes automatically converting the image to an 8-bit image, a 16-bit image, or a 32-bit image.
[0010] Furthermore, when converting to an 8-bit image, the rolling ball background subtraction algorithm is used to perform background noise reduction on the image, and the radius of the rolling ball is set to be no less than the outer radius of the largest analytical target in the image; When converting to a 16-bit or 32-bit image, the rolling ball radius is set to be inversely proportional to the pixel value of the image.
[0011] Furthermore, in S7, after processing is completed, a processing log is output, which includes: the name of the target image file, the type of the target image file, the image size, and the processing time.
[0012] A second aspect of the present invention provides a system for automatic extraction and preprocessing of Western Blot images, comprising: The target subfolder creation unit is used to display a folder selection interface to the user, select the input folder according to the user's instructions, and automatically create the target subfolder under the folder path selected by the user. The target image query unit is used to recursively traverse the folder under the input path and all subfolders under the input path to query target image files that conform to the preset field naming rules. The image file automatic extraction unit is used to copy or move the target image files that meet the preset field naming rules to the target subfolder and automatically complete the extraction of image files; The file traversal unit is used to traverse the files in the target subfolder, automatically skipping the output folder path to avoid recursion from getting into an infinite loop. The image file preprocessing unit is used to perform image type conversion and background noise reduction on the image. Specifically, the rolling ball background subtraction algorithm is used to perform background noise reduction on the converted image. The task notification unit is used to display a task completion notification message to the user after the task is completed.
[0013] Furthermore, the preset field naming rules include: keywords in the image file name and / or image format.
[0014] Furthermore, the image file preprocessing unit performs image type conversion on the image, including automatically converting the image into an 8-bit image, a 16-bit image, or a 32-bit image.
[0015] Furthermore, when converting to an 8-bit image, the image file preprocessing unit uses a rolling ball background subtraction algorithm to perform background noise reduction on the image, and sets the rolling ball radius to be no less than the outer radius of the largest analytical target in the image; When converting to a 16-bit or 32-bit image, the image file preprocessing unit sets the rolling ball radius to be inversely proportional to the pixel value of the image.
[0016] Furthermore, it also includes a log generation unit, used to output a processing log after processing is completed, the processing log including: the name of the target image file, the type of the target image file, the image size, and the processing time.
[0017] The beneficial effects of this invention are as follows: (1) The method and system for automatic extraction and preprocessing of Western Blot images of the present invention are based on the batch image extraction script of the ImageJ platform, which realizes automatic image extraction and improves processing efficiency.
[0018] (2) The method and system for automatic extraction and preprocessing of Western Blot images of the present invention realizes image name keyword filtering, thereby avoiding manual errors and ensuring the accuracy of preprocessed images.
[0019] (3) The method and system for automatic extraction and preprocessing of Western Blot images of the present invention automatically establishes the output path and avoids recursive erroneous copying, realizes automatic filtering of the program, and improves the robustness of the logic. (4) The method and system for automatic extraction and preprocessing of Western Blot images of the present invention automatically performs batch 8-bit conversion and background denoising of images, and can be used as a preprocessing flow for other analysis systems. Attached Figure Description
[0020] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. It is obvious that the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings.
[0021] Figure 1 This is a flowchart illustrating a method for automatic extraction and preprocessing of Western Blot images according to an embodiment of the present invention; Figure 2 This is an illustration of a method for automatic extraction and preprocessing of Western Blot images according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the initial interface used by ImageJ for macro code in an embodiment of the present invention; Figure 4 This is a schematic diagram of the folder selection interface for running macro code according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the interface for automatically extracting target images to a new folder named ImageExtracted, according to an embodiment of the present invention. Figure 6 This is a schematic diagram of the automatically processed image interface according to an embodiment of the present invention; Figure 7 This is a schematic diagram of the log processing interface according to an embodiment of the present invention; Figure 8 This is a schematic diagram of a system for automatic extraction and preprocessing of Western Blot images according to an embodiment of the present invention. Detailed Implementation
[0022] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. It should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0023] Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts disclosed in this invention.
[0024] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. The terms "installed," "connected," and "linked" should be interpreted broadly; for example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal communication of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0025] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of methods and systems consistent with some aspects of the invention as detailed in the appended claims.
[0026] The following describes the technical terms involved in the method and system for automatic extraction and preprocessing of Western Blot images according to the present invention: ImageJ: An image processing platform commonly used for biomedical image analysis.
[0027] bit image: grayscale image format, with each pixel value ranging from 0 to 255.
[0028] Rolling Ball Background Denoising: An image denoising algorithm that removes the background by simulating a rolling ball.
[0029] The present invention proposes a method and system for automatic extraction and preprocessing of Western Blot images. Based on the ImageJ macro language, it constructs an automatic image extraction and preprocessing method and system that can be embedded in the ImageJ platform for execution.
[0030] like Figure 1 and Figure 2 As shown in the figure, the method for automatic extraction and preprocessing of Western Blot images according to an embodiment of the present invention is executed on the ImageJ platform and includes the following steps: S1 displays a folder selection interface to the user, allowing the user to select the input folder according to their instructions.
[0031] Figure 3 This is a diagram illustrating the initial interface for using macro code in ImageJ. Specifically, the system pops up a folder selection interface, where the user selects an input folder. Figure 4 A diagram showing the interface for selecting a folder to run macro code.
[0032] S2 automatically creates the target subfolder in the selected folder path.
[0033] Specifically, a new subfolder named "ImageExtracted" will be automatically created under the selected folder path as the target subfolder.
[0034] S3 recursively traverses the folders under the input path and all subfolders under the input path to query the target image files that conform to the preset field naming rules.
[0035] In embodiments of the present invention, the preset field naming rules include: keywords in the image file name and / or image format. The image format can be customized; images containing names conforming to the user-defined field naming rules can be extracted. The keyword filtering section can be set as a parameter, allowing users to manually set filtering conditions (e.g., ".tif" files).
[0036] For example, the image file name contains "Chemi+Marker", or the image format is .tif or .jpg, or both of the above conditions are met.
[0037] S4 copies or moves the target image files that match the preset field naming rules to the target subfolder, and automatically completes the extraction of image files.
[0038] Figure 5 This is a diagram illustrating the interface for automatically extracting target images to a new folder called ImageExtracted. Figure 5 As shown, after selection, the target image is automatically extracted to a new folder named ImageExtracted. Images to be analyzed containing "Chemi+Marker" in their names are automatically extracted and copied to the new ImageExtracted folder, eliminating the need for manual dragging and dropping.
[0039] It should be noted that the filtering criteria (keywords and image formats) have already been set with naming rules in the source code. They will not be set again when used; instead, images that match the naming rules in the source code will be automatically extracted.
[0040] For example, if an image name contains both "Chemi" and "marker", then copy it to the target subfolder.
[0041] S5 iterates through the files in the target subfolder, automatically skipping the output folder path to avoid the recursion from getting stuck in an infinite loop.
[0042] In embodiments of the present invention, the output path name can be customized.
[0043] S6. After copying the image file, the image is converted to an image type and subjected to background noise reduction. The rolling ball background subtraction algorithm is used to perform background noise reduction on the converted image.
[0044] In this step, the image is converted to an image type, including automatically converting the image to an 8-bit image, a 16-bit image, or a 32-bit image.
[0045] When converting to an 8-bit image, the Rolling Ball background subtraction algorithm is used for background noise reduction. The radius of the rolling ball is set to be no less than the radius of the largest analytical target in the image. For example, after copying an image, it is automatically converted to an 8-bit image and background noise is reduced using the Rolling Ball algorithm with a radius of 50.
[0046] Figure 6 This is a schematic diagram of the automatically processed image interface according to an embodiment of the present invention. Figure 6 As shown, the automatically processed image interface (converted to 8-bit, background noise reduction) automatically performs image type conversion and background noise reduction on all extracted images to be analyzed.
[0047] When converting to a 16-bit or 32-bit image, the rolling ball radius is set to be inversely proportional to the pixel value of the image.
[0048] S7, after processing is complete, displays a task completion message to the user.
[0049] After processing is complete, output the processing log. For example... Figure 7 As shown, the processing log includes: the name of the target image file, the type of the target image file, the image size, and the processing time. The processing log is output, indicating that the task is complete.
[0050] The image extraction and filtering logic of this invention is entirely embedded in ImageJ macro scripts, and can be executed on the ImageJ platform. This technical solution supports processing batch Western Blot images under multi-level directory structures, and has strong scalability and platform compatibility. This invention can subsequently incorporate other advanced processing logic to form a complete analysis process.
[0051] In summary, the method for automatic extraction and preprocessing of Western Blot images according to the present invention is implemented as follows: The user opens the ImageJ platform, runs the Macro script provided by the present invention, and a folder selection dialog box pops up; after selecting the root directory of the original image file, the macro is run with one click, which will create an ImageExtracted folder in the same path and automatically extract the target image. Then, image type conversion to 8-bit and background noise reduction are automatically performed. After processing is complete, the message "All images processed!" is displayed. The Macro script only depends on the ImageJ platform's own components, requires no external dependencies, is cross-platform compatible, and is suitable for operating systems such as macOS and Windows.
[0052] like Figure 8 As shown, the present invention also proposes a system for automatic extraction and preprocessing of Western Blot images, comprising: a target subfolder creation unit 1, a target image query unit 2, an image file automatic extraction unit 3, a file traversal unit 4, an image file preprocessing unit 5, and a task prompting unit 6.
[0053] Specifically, the target subfolder creation unit 1 is used to display a folder selection interface to the user, select the input folder according to the user's instructions, and automatically create the target subfolder under the folder path selected by the user.
[0054] The system displays a folder selection interface, and the user selects the input folder. Target subfolder creation unit 1 automatically creates a new subfolder named "ImageExtracted" under the selected folder path, which will serve as the target subfolder.
[0055] The target image query unit 2 is used to recursively traverse the folder under the input path and all subfolders under the input path to query target image files that conform to the preset field naming rules.
[0056] In embodiments of the present invention, the preset field naming rules include: keywords in the image file name and / or image format. The image format can be customized; images containing names conforming to the user-defined field naming rules can be extracted. The keyword filtering section can be set as a parameter, allowing users to manually set filtering conditions (e.g., ".tif" files).
[0057] The image file automatic extraction unit 3 is used to copy or move the target image files that meet the preset field naming rules to the target subfolder and automatically complete the extraction of image files.
[0058] Specifically, the image file automatic extraction unit 3 automatically extracts the target image to a new folder named ImageExtracted after selection. Images to be analyzed in the target folder containing "Chemi+Marker" in their names are automatically extracted and copied to the new ImageExtracted folder, eliminating the need for manual dragging and dropping.
[0059] It should be noted that the filtering criteria (keywords and image formats) have already been set with naming rules in the source code. They will not be set again when used; instead, images that match the naming rules in the source code will be automatically extracted.
[0060] File traversal unit 4 is used to traverse the files in the target subfolder, automatically skipping the output folder path to avoid recursion getting stuck in an infinite loop.
[0061] Image file preprocessing unit 5 is used to perform image type conversion and background noise reduction on the image. Specifically, the rolling ball background subtraction algorithm is used to perform background noise reduction on the converted image.
[0062] The image file preprocessing unit 5 performs image type conversion on the image, including automatically converting the image to an 8-bit image, a 16-bit image, or a 32-bit image.
[0063] When converting to an 8-bit image, the image file preprocessing unit 5 uses the rolling ball background subtraction algorithm to perform background noise reduction on the image, and sets the rolling ball radius to be no less than the outer radius of the largest analysis target in the image.
[0064] For example, after copying an image, it is automatically converted to an 8-bit image and background noise is reduced using the Rolling Ball background subtraction algorithm with a radius of 50.
[0065] When converting to a 16-bit or 32-bit image, the image file preprocessing unit sets the rolling ball radius to be inversely proportional to the pixel value of the image.
[0066] Task prompt unit 6 is used to display a task completion prompt message to the user after the task is completed.
[0067] In addition, the system for automatic extraction and preprocessing of Western Blot images of the present invention further includes: a log generation unit, used to output a processing log after processing is completed, the processing log including: the name of the target image file, the type of the target image file, the image size, and the processing time.
[0068] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the protection scope of the present invention.
Claims
1. A method for Western Blot image automatic extraction and preprocessing, characterized in that, The method is executed based on an ImageJ platform and comprises the following steps: S1, a folder selection interface is displayed to a user, and an input folder is selected according to a user instruction; S2, a target subfolder is automatically created under a selected folder path; S3, a folder under an input path and all subfolders under the input path are recursively traversed to query target image files that meet a preset field naming rule; S4, the target image files that meet the preset field naming rule are copied or moved to the target subfolder, and extraction of the image files is automatically completed; S5, files in the target subfolder are traversed, and an output folder path is automatically skipped to avoid a recursive dead loop; S6, after the image files are copied, the image is subjected to picture type conversion and background noise reduction processing, wherein a rolling ball background deduction algorithm is used to perform background noise reduction processing on the converted image; S7, after the processing is completed, a task completion prompt information is displayed to the user.
2. A method for automatic extraction and pre-processing of Western Blot images according to claim 1, characterized in that, In S4, the preset field naming rule comprises a keyword of an image file name and / or a picture format.
3. A method for automatic extraction and pre-processing of Western Blot images as claimed in claim 1, wherein, In S6, the image is subjected to picture type conversion, comprising automatically converting the image into an 8-bit image, a 16-bit image or a 32-bit image.
4. A method for automatic extraction and pre-processing of Western Blot images according to claim 3, characterized in that, When the image is converted into an 8-bit image, the rolling ball background deduction algorithm is used to perform background noise reduction processing on the image, and a rolling ball radius is set to be not less than a shape radius of a largest analysis target in the image; When the image is converted into a 16-bit image or a 32-bit image, the rolling ball radius is set to be inversely proportional to a pixel value of the image.
5. The method for automatic extraction and pre-processing of Western Blot images as claimed in claim 1 wherein, In S7, after the processing is completed, a processing log is output, and the processing log comprises a name of a target image file, a type of the target image file, a picture size and a processing time.
6. A system for automatic extraction and pre-processing of Western Blot images, characterized in that, The system for implementing the method of any one of claims 1 to 5 comprises: a target subfolder creation unit configured to display a folder selection interface to a user, select an input folder according to a user instruction, and automatically create a target subfolder under a folder path selected by the user; a target image query unit configured to recursively traverse a folder under an input path and all subfolders under the input path to query target image files that meet a preset field naming rule; an image file automatic extraction unit configured to copy or move the target image files that meet the preset field naming rule to the target subfolder to automatically complete extraction of the image files; a file traversal unit configured to traverse files in the target subfolder and automatically skip an output folder path to avoid a recursive dead loop; an image file preprocessing unit configured to convert the image into a picture type and perform background noise reduction processing, wherein a rolling ball background deduction algorithm is used to perform background noise reduction processing on the converted image; a task prompt unit configured to display a task completion prompt information to the user after the processing is completed.
7. The system for automatic extraction and pre-processing of Western Blot images according to claim 6, characterized in that, The preset field naming rule comprises a keyword of an image file name and / or a picture format.
8. The system for automatic extraction and pre-processing of Western Blot images according to claim 6, characterized in that, The image file preprocessing unit converts the image into a picture type, comprising automatically converting the image into an 8-bit image, a 16-bit image or a 32-bit image.
9. The system for automatic extraction and pre-processing of Western Blot images according to claim 8, characterized in that, When the image file pre-processing unit performs background noise reduction processing on the image by using a rolling ball background deduction algorithm when converting into an 8-bit image, the rolling ball radius is set to be not less than the shape radius of the largest analysis target in the image; When converting into a 16-bit image or a 32-bit image, the image file pre-processing unit sets the rolling ball radius to be inversely proportional to the pixel value of the image.
10. The system for automatic extraction and pre-processing of Western Blot images according to claim 6, characterized in that, Further comprising: A log generation unit is configured to output a processing log after processing is completed, wherein the processing log comprises: the name of the target image file, the type of the target image file, the picture size and the processing time.