A method for archiving TB-level biomedical three-dimensional image data in a big data format
By slicing and dividing TB-level biomedical 3D image data into regions, and using the continuity features in the z-axis direction for compression, and processing 3D blocks in parallel, the problems of long production time and high cost in existing technologies are solved, achieving rapid production and efficient decompression.
Patent Information
- Application Number
- CN202211699990.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2042-12-28
Smart Images

Figure CN115982099B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of biomedicine, and more particularly relates to a TB-level biomedical three-dimensional image data big data format archiving method. BACKGROUND
[0002] The production of TB-level biomedical three-dimensional image data big data format is to slice the original image sequence at different resolutions. The highest resolution is big data format 0, and the number of three-dimensional blocks is the most. With each increment of 1 level, two three-dimensional blocks in each of the x, y and z directions of the previous level are merged, and then each of the three directions is down-sampled by 2 times to generate a new three-dimensional block. The resolution is reduced by 8 times, and the number of three-dimensional blocks is reduced by 8 times. The three-dimensional block facilitates fast virtual coordinate block access during subsequent visualization. Multi-resolution is used for low-resolution images in a large field of view and high-resolution images in a small field of view during visualization interaction, thereby meeting the visualization needs of real-time three-dimensional interaction.
[0003] In the slicing process, the image sequence is read frame by frame, two-dimensional slicing is performed on each frame, and then the image is compressed and written into a three-dimensional block corresponding to the resolution of big data format 0. After down-sampling, two-dimensional slicing and compression, the image is written into a three-dimensional block corresponding to big data format 1. The same method is used to produce the remaining big data formats of levels 2, 3, …, n. The maximum level n of the big data format can be set artificially or calculated according to the requirements. For example, when the minimum pixel length in the x, y and z axial directions of a certain level is less than a certain value, the maximum big data format level n is reached. After the above processing is performed on other frames in the image sequence, the big data format is obtained.
[0004] However, the existing production method has a long compression time, a low compression ratio, and a slow decompression speed after compression. The slow decompression speed results in that only low-resolution images can be viewed during subsequent visualization, and high-resolution images need to be waited for several seconds, which is poor in user experience. Secondly, during the production of the big data image sequence, the image size is large, and all the images are read into the memory, which occupies a large amount of device computing memory. Opening a large number of three-dimensional small block files and saving the whole image slice to the corresponding three-dimensional small block file can cause poor IO stability and easy crashes. The storage addresses of each small block are not continuous, resulting in random writing of most of the data and slow performance. In addition, it takes several seconds to read each image, and only the image reading time is used, which is not high in resource utilization and low in production efficiency. The existing scheme generally uses a cluster to solve the problems of long production time, low efficiency and easy crashes of TB-level biomedical three-dimensional image data big data format production. However, the cluster is expensive and complex to build, and is difficult to be widely applied. SUMMARY
[0005] In view of the defects and improvement needs of the prior art, the present application provides a TB-level biomedical three-dimensional image data big data format archiving method, which aims to provide a TB-level biomedical three-dimensional image data big data format archiving method with low cost and fast decompression speed.
[0006] To achieve the above-mentioned purpose, according to one aspect of the present application, a TB-level biomedical three-dimensional image data big data format archiving method is provided, comprising:
[0007] Slicing each two-dimensional image in the TB-level biomedical two-dimensional image sequence, wherein the slice information of each two-dimensional image is consistent, and the slice information comprises: the number of slices, the size of the slices and the coordinates of each slice position;
[0008] Regionally dividing each two-dimensional image to group the slices, the number, size and position coordinates of the regional division of each two-dimensional image are consistent; superimposing the regions corresponding to each same position coordinate between each two-dimensional image to obtain a three-dimensional local block corresponding to each position coordinate, the length of the three-dimensional local block is the length of the TB-level biomedical two-dimensional image sequence, and the width and height are the width and length of the corresponding region;
[0009] Respectively and independently reading each three-dimensional local block into the memory to respectively slice each three-dimensional local block to obtain a plurality of three-dimensional small blocks, the length of each three-dimensional small block is the length of the TB-level biomedical two-dimensional image sequence, and the width and height are the height and width of one or more slices; using the information of the continuous change of the z-axis direction of each three-dimensional small block to compress the three-dimensional small block, and writing the compressed data into the storage container corresponding to the three-dimensional small block to complete the 0-level big data format archiving of the TB-level biomedical two-dimensional image sequence, wherein the z-axis direction represents the arrangement direction of the TB-level biomedical two-dimensional image sequence.
[0010] Further, it further comprises: n times downsampling each three-dimensional local block, respectively and independently reading each three-dimensional local block after downsampling to respectively slice each three-dimensional local block after downsampling to obtain a plurality of three-dimensional small blocks, the length of each three-dimensional small block is the length of the TB-level biomedical two-dimensional image sequence, and the width and height are the height and width of one or more slices; using the information of the continuous change of the z-axis direction of each three-dimensional small block to compress the three-dimensional small block, and writing the compressed data into the storage container corresponding to the three-dimensional small block to complete the n-level big data format archiving of the TB-level biomedical two-dimensional image sequence, n is a positive integer.
[0011] Further, before slicing each two-dimensional image in the TB-level biomedical two-dimensional image sequence, it further comprises: calculating the slice information corresponding to the 0-level big data format of each two-dimensional image in the TB-level biomedical two-dimensional image sequence and the size of the three-dimensional local block, specifically:
[0012] (1) The number of slices nx0 and ny0 of each two-dimensional image in the x and y directions is calculated in the following manner:
[0013]
[0014] wherein, is the ceiling function, bh and bw represent the height and width of the TB-level biomedical two-dimensional image sequence respectively, h0 and w0 represent the height and width of the three-dimensional small block corresponding to the 0-level big data format respectively, rh and rw represent the redundant height and width between slices, the z-axis direction is not provided with redundancy, and the x and y directions represent the height and width directions of the image respectively;
[0015] (2) Assuming that the x and y direction serial numbers of each slice are idx0 and idy0 respectively, idx0 is the x direction idx0+1 block, and idy0 is the y direction idy0+1 block, the start coordinates of the current slice are startPx0 and startPy0, and the end coordinates are endPx0 and endPy0, the calculation formula is:
[0016]
[0017] wherein min() is the minimum value;
[0018] (3) The three-dimensional local block size is calculated in the following manner:
[0019]
[0020] wherein sw and sh are the height and width of the three-dimensional local block respectively.
[0021] Further, it further comprises: calculating the slice information and the three-dimensional local block size corresponding to the n-level big data format of each two-dimensional image in the TB-level biomedical two-dimensional image sequence, specifically:
[0022] (1) The height and width h1 and w1 of the three-dimensional small block corresponding to the 1-level big data format are calculated in the following manner:
[0023] (2) The number of slices nx0 and ny0 of each two-dimensional image in the x and y directions corresponding to the 1-level big data format is calculated in the following manner:
[0024]
[0025] wherein, is the ceiling function;
[0026] (3) Assuming that the x and y direction serial numbers of each slice are idx1 and idy1 respectively, idx1 is the x direction idx1+1 block, idy1 is the y direction idy1+1 block, the start coordinates of the current slice are startPx1 and startPy1, and the end coordinates are endPx1 and endPy1, the calculation formula is as follows:
[0027]
[0028] Wherein, min() is the minimum value.
[0029] (4) The other level large data format has no redundancy with the first level large data format, and the corresponding slice information and three-dimensional local block size are calculated in the same parameter calculation manner.
[0030] Further, the three-dimensional small block is compressed by using the information that each three-dimensional small block changes continuously in the z axis direction, and the specific implementation manner is as follows:
[0031] By using the z axis direction continuity feature of the three-dimensional small block image data, the second frame is represented by the first frame plus the change information of the second frame and the first frame, the third frame is represented by the second frame plus the change information of the third frame and the second frame, and so on, so as to realize the compression of the three-dimensional small block.
[0032] Further, while performing frame-by-frame compression on each three-dimensional small block corresponding to the current level large data format, the maximum value sampling is performed on the two frames of two-dimensional images in each three-dimensional local block, and finally the three-dimensional local block corresponding to the next level large data format is generated.
[0033] Further, when reading each three-dimensional local block into the memory respectively and independently, the reading manner of each three-dimensional local block is as follows: each frame of the three-dimensional local block is read in series, and each frame of data read is decoded in parallel.
[0034] The application also provides a computer readable storage medium, which comprises a stored computer program, wherein when the computer program is run by a processor, the device where the storage medium is located performs the above-mentioned TB level biomedical three-dimensional image data large data format archiving method.
[0035] Overall, the above technical solutions conceived by the application can achieve the following beneficial effects:
[0036] (1) The method of the application uses the continuity of the z-axis of biomedical three-dimensional images for the compression of three-dimensional images, and proposes a direct and fast reading method for local images, to realize the fast production of TB-level biomedical three-dimensional image data in a large data format. Specifically, the cutting information of the large data image is calculated; the local block is directly and quickly read, and no matter how large the size of the three-dimensional image sequence is, the original image can be divided into a plurality of local blocks which are completely independent and can be processed, so that it is suitable for the production of TB-level biomedical three-dimensional image data in a large data format of all sizes. In addition, the size of the local block is not large, and compared with directly processing the original image, the IO stability is strong, the continuous writing operation is more, and the writing speed is fast; the local block is sliced in the memory in combination with the calculated cutting information, and finally the image is compressed using the z-axis continuity feature and continuously written into the corresponding storage container in a large data format, to realize the fast production of TB-level biomedical three-dimensional image data in a large data format. The method has the advantages of fast production speed, high compression ratio, and fast and stable image restoration speed after decompression, and can solve the problems of high cost, poor usability and low practicality in the prior art.
[0037] (2) When reading the three-dimensional local block, compared with the traditional method in which one frame is divided into a plurality of parts, one part is read each time, then decoded, and then another part is read, when reading the image in parallel, there will be a large number of random reading, and the random reading performance of the hard disk is very low, and the image reading speed is slow. The method of the application adopts the method of sequentially and serially reading each frame of the three-dimensional local block, and simultaneously decoding and reading each frame of data, which greatly reduces the number of random reading when reading the image, and theoretically reaches the limit of the hard disk reading speed.
[0038] (3) The method of the application has high parallel processing feasibility. In the production of each level of large data format, the three-dimensional local blocks can be parallelly processed for three-dimensional small block cutting and data compression. In addition, in the process from three-dimensional local block cutting to three-dimensional small block and in the process from three-dimensional small block to data compression, downsampling can be performed in parallel to produce the next level of large data format, which greatly improves the archiving speed. BRIEF DESCRIPTION OF DRAWINGS
[0039] Figure 1 A flow chart of a TB-level biomedical three-dimensional image data large data format archiving method provided for an embodiment of the application;
[0040] Figure 2 A flow chart of a TB-level biomedical three-dimensional image data large data format archiving method provided for an embodiment of the application. DETAILED DESCRIPTION
[0041] In order to make the objectives, technical solutions and advantages of the present application clearer, further detailed description will be made to the present application in combination with the accompanying drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application and should not be used to limit the present application. In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.
[0042] Embodiment one
[0043] A large data format archiving method of TB-level biomedical three-dimensional image data, as shown in Figure 1 , comprising:
[0044] Slicing each frame of two-dimensional image in the sequence of TB-level biomedical two-dimensional images, wherein the slicing information of each frame of two-dimensional image is consistent, and the slicing information comprises: the number of slices, the size of slices and the position coordinates of each slice;
[0045] Region division is performed on each frame of two-dimensional image to group the slices, the number, size and position coordinates of region division of each frame of two-dimensional image are consistent, and the number, size and position coordinates of the slices of the region corresponding to the same position coordinates between each frame are the same; superimposing the region corresponding to each same position coordinates between each frame of two-dimensional image, a three-dimensional local block corresponding to each position coordinates is obtained, the length of the three-dimensional local block is the length of the sequence of TB-level biomedical two-dimensional images, and the width and height are the width and length of the corresponding region;
[0046] Respectively and independently reading each three-dimensional local block to the memory, to respectively slice each three-dimensional local block, to obtain a plurality of three-dimensional small blocks, the length of each three-dimensional small block is the length of the sequence of TB-level biomedical two-dimensional images, and the width and height are the height and width of one or more slices; using the information of continuous change of each three-dimensional small block in the z-axis direction, the three-dimensional small block is compressed, and the compressed data is written into the storage container corresponding to the three-dimensional small block, to complete the 0-level large data format archiving of the sequence of TB-level biomedical two-dimensional images, wherein the z-axis direction represents the arrangement direction of the sequence of TB-level biomedical two-dimensional images.
[0047] As a preferred embodiment, the method further comprises:
[0048] n times of downsampling are performed on each three-dimensional local block, each downsampled three-dimensional local block is read independently to perform cutting on each downsampled three-dimensional local block respectively, and a plurality of three-dimensional small blocks are obtained, each three-dimensional small block has a length of the length of the TB-level biomedical two-dimensional image sequence, and has a width and a height of the height and the width of one or more slices; information of continuous change of each three-dimensional small block in the z-axis direction is used to compress the three-dimensional small block, and compressed data is written into a storage container corresponding to the three-dimensional small block, so that n-level large data format archiving of the TB-level biomedical two-dimensional image sequence is completed, and n is a positive integer.
[0049] It should be noted that before the slices of each frame of the TB-level biomedical two-dimensional image sequence are cut, the slice information corresponding to the 0-level large data format and the three-dimensional local block size of each frame of the TB-level biomedical two-dimensional image sequence are calculated, and the calculation method is as follows:
[0050] (1) The number of slices nx0 and ny0 of each frame of the two-dimensional image in the x and y directions is calculated, and the calculation method is as follows:
[0051]
[0052] wherein, is rounded up, bh and bw represent the height and the width of the TB-level biomedical two-dimensional image sequence respectively, h0 and w0 represent the height and the width of the three-dimensional small block corresponding to the 0-level large data format respectively, rh and rw represent the redundant size of the height and the width of the slices, the z-axis direction is not provided with redundancy, and the x and y directions represent the height and the width directions of the image respectively;
[0053] (2) Assuming that the x and y direction serial numbers of each slice are idx0 and idy0 respectively, idx0 is the x direction idx0+1 block, idy0 is the y direction idy0+1 block, the start coordinates of the current slice are startPx0 and startPy0, and the end coordinates are endPx0 and endPy0, the calculation formula is as follows:
[0054]
[0055] wherein min() is the minimum value;
[0056] (3) The three-dimensional local block size calculation method is as follows:
[0057]
[0058] wherein sw and sh are the height and the width of the three-dimensional local block respectively.
[0059] In addition, the method further comprises: calculating slice information corresponding to the n-level big data format of each two-dimensional image in the sequence of two-dimensional biomedical images at the TB level and a three-dimensional local block size, and the calculation manner is specifically as follows in the preferred embodiment:
[0060] (1) calculating the three-dimensional small block height and width h1 and w1 corresponding to the 1-level big data format, and the calculation manner is as follows:
[0061] (2) calculating the x and y direction slice numbers nx0 and ny0 of each two-dimensional image in the 1-level big data format, and the calculation manner is as follows:
[0062]
[0063] wherein, is a rounding up operation;
[0064] (3) assuming that the x and y direction serial numbers of each slice are idx1 and idy1 respectively, idx1 is the (idx1+1)th block in the x direction, and idy1 is the (idy1+1)th block in the y direction, then the start coordinates of the current slice are startPx1 and startPy1, and the end coordinates are endPx1 and endPy1, and the calculation formula is as follows:
[0065]
[0066] wherein, min() is the minimum value.
[0067] (4) other levels of big data formats do not have redundancy with the 1-level big data format, and the corresponding slice information and three-dimensional local block size are calculated in the same parameter calculation manner.
[0068] As a preferred embodiment, the above uses the information of the z-axis direction continuous change of each three-dimensional small block to compress the three-dimensional small block, and the specific implementation manner is as follows:
[0069] By using the z-axis direction continuity feature of the three-dimensional small block image data, the first frame in the three-dimensional small block is used to represent the second frame by using the change information of the second frame and the first frame, the second frame is used to represent the third frame by using the change information of the third frame and the second frame, and so on, so as to realize the compression of the three-dimensional small block.
[0070] Further, as a preferred embodiment, while performing frame-by-frame compression on each three-dimensional small block corresponding to the current level of big data format, the maximum value sampling is performed on the continuous two frames of two-dimensional images in each three-dimensional local block, and finally the three-dimensional local block corresponding to the next level of big data format is generated.
[0071] In order to better illustrate the present application, the specific steps of performing multi-level big data format archiving are as follows:
[0072] S01, set 0-level large data format three-dimensional small block size, 0-level large data format three-dimensional small block redundancy size parameter information, according to the setting parameters, calculate the size of each level of large data format three-dimensional small block, original image sequence slice information.
[0073] Specifically, in a specific embodiment, in step S01, according to the z-axis continuity compression method, any frame image information can be quickly decompressed and read, and when calculating the slice information of the large data format, the z-axis is default to have no redundancy, and the z-axis length of the three-dimensional small block is the length of the large data image sequence. The large data format only supports redundancy at level 0, and other levels are used for visualization and do not need to support redundancy, so the 0-level large data format three-dimensional small block size is different from the three-dimensional block size of other levels, and the calculation method of the slice information is also different, and the specific calculation method is as follows:
[0074] Suppose the TB level image sequence length and width are bh and bw, and the sequence length is bz, and the 0-level large data format length and width are h0 and w0. Since the compression algorithm of the present application can quickly and directly read any frame, the z-axis length of the 0-level three-dimensional small block is default to be the image sequence length bz, and no redundancy is set in the z direction, and the redundancy size is rh and rw.
[0075] S11, the 0-level large data format x and y direction slice number of the large data image sequence is nx0 and ny0 respectively, and the calculation method is as follows:
[0076]
[0077]
[0078] wherein is the ceiling.
[0079] S12, assuming that the x and y direction sequence numbers of each slice are idx0 and idy0 respectively, idx0 is the x direction idx0+1 block, and idy0 is the y direction idy0+1 block, then the current slice start coordinate is startPx0 and startPy0, and the end coordinate is endPx0 and endPy0, and the calculation formula is as follows:
[0080] startPx0=(w0-rw)*idx0
[0081] startPy0=(h0-rh)*idy0
[0082] endPx0=min(startPx+w0,bw)
[0083] endPy0=min(startPy+h0,bh)
[0084] wherein min() is the minimum value.
[0085] S13, the size of the local block is sw, sh, because one local block needs to be encoded in two levels, one two-level block needs to be composed of 4 zero-level blocks in x and y directions, and the local block is read in a row as continuous reading, so the size of the local block is calculated as follows:
[0086] sw = bw
[0087] sh = 3 * (h0-w0) + h0
[0088] S14, the 1st level large data format and the 2nd level large data format have no redundancy, and the parameter calculation method is the same, taking the 1st level large data format parameter calculation method as an example.
[0089] The size of the 1st level large data format is h1 and w1 respectively, and the calculation method is as follows:
[0090] w1 = w0-rw
[0091] h1 = h0-rh
[0092] S15, the number of slices in x and y directions of the 1st level large data format on the TB level image sequence is nx1 and ny1 respectively, and the calculation method is as follows:
[0093]
[0094]
[0095] wherein is the ceiling.
[0096] S16, assuming that the x and y direction serial numbers of each slice are idx1 and idy1 respectively, idx1 is the x direction idx1+1 block, and idy1 is the y direction idy1+1 block, then the start coordinates of the current slice are startPx1 and startPy1, and the end coordinates are endPx1 and endPy1, and the calculation formula is as follows:
[0097] startPx1 = w1*idx1
[0098] startPy1 = h1*idy1
[0099] endPx1 = min(startPx+w1,bw)
[0100] endPy1 = min(startPy+h1,bh)
[0101] wherein min() is the minimum value.
[0102] S02, directly read the local slice of each frame of the original image sequence, superimpose the local slice read by each frame to obtain the corresponding local block, and create a storage container corresponding to the 0th, 1st and 2nd large data formats.
[0103] In this step S02, local data is read, which is directly and continuously read from the local image data in the disk, fast, and supports fast local data reading of compressed images. Direct and fast reading of local data, for each frame, directly writes the compressed data into the corresponding storage container. This process is continuous writing for IO operation, with the highest disk utilization, fast and stable writing speed; secondly, regardless of the size of the three-dimensional image sequence, the original image can be divided into completely independent local blocks for processing, which is suitable for large data format production of images of all sizes. The size of the local block is not large, and the IO stability is strong, the continuous writing operation is more, and the writing speed is fast.
[0104] S03, according to the large data format information calculated in S01, each frame slice of the read local block is obtained, and the 0th three-dimensional small block is obtained. The 0th three-dimensional small block is a two-dimensional small piece of each frame xy plane slice of the three-dimensional local block, and the two-dimensional small blocks of the same xy position of each frame in the z direction are superimposed to obtain the 0th three-dimensional small block. For each 0th small block, the z-axis continuous change feature of the original image sequence is used for compression and continuous writing into the storage container corresponding to the 0th large data format.
[0105] That is, in step S03, the local block read into the memory in S02 is cut into 0th small blocks by 0th large data format, and each 0th small block is compressed using the z-axis continuity. The first frame plus the change information of the second frame and the first frame represents the second frame, the second plus the change information of the third frame and the second frame represents the third frame, and so on. This method can represent any frame. Using this method to compress three-dimensional images and write into the storage container idx_idy.avi corresponding to the 0th large data format. The 0th large data format slice supports redundant slices, that is, the continuous two three-dimensional small block data allows overlapping, which is convenient for subsequent global analysis.
[0106] In step S03, the 0th large data format production supports redundant production, that is, the continuous two three-dimensional small block data allows overlapping, which is convenient for subsequent global analysis.
[0107] S04, when collecting two consecutive frames of local blocks, maximum value sampling is performed in x, y, z directions respectively, sampling step is 2, and a first-level local block is obtained; for each slice of the first-level local block, a first-level three-dimensional small block is obtained, and the first-level three-dimensional small block is that each frame of xy plane slice of the three-dimensional local block is divided into a plurality of two-dimensional small pieces, and the two-dimensional small blocks with the same xy position of each frame in the z direction are superimposed to obtain the first-level three-dimensional small block. For each first-level small block, compression is performed by using the continuous change characteristics of the z axis of the original image sequence, and is continuously written into a storage container corresponding to the first-level large data format.
[0108] In this step S04, the local blocks read into the memory in the step S02 are collected, maximum value sampling is performed in x, y, z directions respectively, sampling step is 2, and a first-level small block is obtained, and for each first-level small block, compression is performed by using the z axis continuity, the first frame is added to the change information of the second frame and the first frame to represent the second frame, the second frame is added to the change information of the third frame and the second frame to represent the third frame, and the method can represent any frame. The three-dimensional image is compressed by using the method and written into an idx_idy.avi storage container corresponding to the first-level large data format.
[0109] S05, when collecting two consecutive frames of first-level local blocks, maximum value sampling is performed in x, y, z directions respectively, sampling step is 2, and a second-level local block is obtained; for each slice of the second-level local block, a second-level three-dimensional small block is obtained, and the second-level three-dimensional small block is that each frame of xy plane slice of the three-dimensional local block is divided into a plurality of two-dimensional small pieces, and the two-dimensional small blocks with the same xy position of each frame in the z direction are superimposed to obtain the second-level three-dimensional small block. For each second-level small block, compression is performed by using the continuous change characteristics of the z axis of the original image sequence, and is continuously written into a storage container corresponding to the second-level large data format.
[0110] In the step S05, the first-level small blocks in the step S04 are collected, maximum value sampling is performed in x, y, z directions respectively, sampling step is 2, and a second-level small block is obtained, and for each second-level small block, compression is performed by using the z axis continuity, the first frame is added to the change information of the second frame and the first frame to represent the second frame, the second frame is added to the change information of the third frame and the second frame to represent the third frame, and the method can represent any frame. The three-dimensional image is compressed by using the method and written into an idx_idy.avi storage container corresponding to the first-level large data format.
[0111] S06, after each frame of local blocks is processed according to the above method, the large data format is completed, and the above method can only obtain 0-level, 1-level and 2-level three-layer large data formats. If more levels of large data formats are needed, the second-level large data format can be directly sampled and combined. Since the size of the second-level large data format is more than 100 times smaller than the original image, performance problems do not need to be considered.
[0112] In step S06, all the local blocks in step S01 are processed according to all the steps S02-S05, and the large data format is completed.
[0113] It should be noted that the compression algorithm in steps S03, S04 and S05 uses the z-axis continuity feature of the biomedical three-dimensional image data to represent the second frame by using the first frame and the change information of the second frame from the first frame, represent the third frame by using the second frame and the change information of the third frame from the second frame, and so on. This method can represent any frame. The compression speed of the three-dimensional image is extremely fast, the compression ratio is high, and the decoding speed of the compressed image is fast, so as to realize the fast production of the large data format.
[0114] In addition, in the reading of the three-dimensional local block, the method of the embodiment is divided into multiple parts for each frame, and each part is read and then decoded, and then another part is read. When the image is read in parallel, a large amount of random reading is required, and the random reading performance of the hard disk is low, and the image reading speed is slow. The method of the embodiment proposes a method of sequentially and serially reading each frame of the three-dimensional local block, and simultaneously decoding and reading each frame of data, which greatly reduces the number of random readings when the image is read, and theoretically reaches the limit of the hard disk reading speed.
[0115] In summary, the method of the embodiment uses the z-axis continuity of the biomedical three-dimensional image for the compression of the three-dimensional image, and simultaneously proposes a direct and fast reading method of the local image, so as to realize the fast production of the TB-level biomedical three-dimensional image data in the large data format. Specifically, the cutting block information of the large data image is calculated; the local block is directly and quickly read, and no matter how the size of the three-dimensional image sequence is, the original image can be divided into a plurality of local blocks which are completely independent and processed, so that the method is suitable for the production of the TB-level biomedical three-dimensional image data in the large data format. In addition, the size of the local block is not large, the IO stability is strong, the continuous writing operation is more, and the writing speed is fast, compared with the direct processing of the original image. The local block is sliced in the memory in combination with the calculated cutting block information, and finally the image is compressed by using the z-axis continuity feature and continuously written into the corresponding storage container in the large data format, so as to realize the fast production of the TB-level biomedical three-dimensional image data in the large data format. The method has the advantages of fast production speed, high compression ratio, and fast and stable image restoration speed, and can solve the problems of high cost, poor usability and low practicability in the prior art.
[0116] The method of the embodiment will be further described in detail in combination with the accompanying drawings:
[0117] As Figure 2As shown, the application is a TB-level biomedical three-dimensional image data big data format production method, which calculates TB-level image sequence slice information, divides the image sequence into several three-dimensional local blocks, and stacks the two-dimensional small blocks at the same xy position of each frame in the z direction to obtain a three-dimensional local block; a three-dimensional local block is directly and quickly read; the three-dimensional local block is sliced to obtain a 0-level three-dimensional small block, which is a two-dimensional small piece of each frame of the three-dimensional local block z-axis xy plane slice, stacked with the two-dimensional small block at the same xy position of each frame in the z direction to obtain several 0-level three-dimensional small blocks; each 0-level small block is compressed using z-axis continuity, using the first frame plus the change information of the second frame and the first frame to represent the second frame, the second plus the change information of the third frame and the second frame to represent the third frame, and so on, which can represent any frame. Using this method for continuous compression, several compressed 0-level three-dimensional small blocks are obtained; the compressed 0-level three-dimensional small block is an integral whole, and the compressed 0-level three-dimensional small block is continuously written into the corresponding 0-level big data format storage container; the three-dimensional local block is down-sampled to obtain a 1-level three-dimensional local block, and the 0-level big data format production is similar, the 1-level three-dimensional local block is sliced, compressed and continuously written into the corresponding 1-level big data format storage container; the 1-level three-dimensional local block is down-sampled, and the similar method is sliced, compressed and continuously written into the corresponding 2-level big data format storage container; after all the local blocks are processed, the big data format production is completed.
[0118] Example two
[0119] A computer readable storage medium comprising a stored computer program, wherein the computer program, when executed by a processor, controls the device in which the storage medium is located to perform a TB-level biomedical three-dimensional image data big data format archiving method as described above.
[0120] The related technical solutions are the same as those of example one, and will not be described here.
[0121] Those skilled in the art will readily understand that the above description is only a preferred embodiment of the application and is not intended to limit the application, and any modifications, equivalent replacements and improvements made within the spirit and principles of the application shall be included in the protection scope of the application.
Claims
1. A method for archiving terabyte-level biomedical three-dimensional image data in a large data format, characterized in that, include: Slicing is performed on each frame of a TB-level biomedical two-dimensional image sequence, wherein the slice information of each frame of the two-dimensional image is consistent, and the slice information includes: the number of slices, the slice size, and the position coordinates of each slice. Each frame of two-dimensional image is divided into regions to group slices. The number, size and position coordinates of the regions in each frame of two-dimensional image are consistent. The regions corresponding to the same position coordinates between each frame of two-dimensional image are superimposed to obtain a three-dimensional local block corresponding to each position coordinate. The length of the three-dimensional local block is the length of the TB-level biomedical two-dimensional image sequence, and the width and height are the width and length of the corresponding region. Each 3D local block is read independently into memory, and then each 3D local block is sliced to obtain several 3D small blocks. The length of each 3D small block is the length of the TB-level biomedical 2D image sequence, and the width and height are the height and width of one or more slices. Using the information of the continuous change of the z-axis direction of each 3D small block, the 3D small block is compressed, and the compressed data is written into the storage container corresponding to the 3D small block, thus completing the 0-level big data format archiving of the TB-level biomedical 2D image sequence. The z-axis direction represents the arrangement direction of the TB-level biomedical 2D image sequence. The method of compressing the three-dimensional block by utilizing the continuously changing information along the z-axis of each block is specifically implemented as follows: By leveraging the z-axis continuity characteristics of 3D patch image data, the second frame is represented by the first frame plus the change information between the second and first frames, the third frame is represented by the second frame plus the change information between the third and second frames, and so on, thus achieving compression of the 3D patch.
2. The big data format archiving method according to claim 1, characterized in that, Also includes: Each three-dimensional local block is downsampled n times, and each downsampled three-dimensional local block is read independently. Each downsampled three-dimensional local block is then sliced to obtain several three-dimensional small blocks. The length of each three-dimensional small block is the length of the TB-level biomedical two-dimensional image sequence, and the width and height are the height and width of one or more slices. By utilizing the information of the continuous change in the z-axis direction of each three-dimensional block, the three-dimensional block is compressed, and the compressed data is written into the storage container corresponding to the three-dimensional block, thus completing the archiving of the TB-level biomedical two-dimensional image sequence in n-level big data format, where n is a positive integer.
3. The big data format archiving method according to claim 1, characterized in that, Before slicing each frame of a TB-level biomedical two-dimensional image sequence, the process also includes: calculating the slice information and three-dimensional local block size corresponding to the level 0 big data format of each frame of the TB-level biomedical two-dimensional image sequence, specifically: (1) Calculate the number of slices in the x and y directions of each frame of the two-dimensional image. nx0 and ny0 The calculation method is as follows: ; in, To round up, bh and bw These represent the height and width of the TB-level biomedical two-dimensional image sequence, respectively. h0 and w0 These represent the height and width of the three-dimensional block corresponding to the Level 0 big data format, respectively. rh and rw These represent the redundant dimensions (height and width) of overlapping slices, respectively; the z-axis direction has no redundancy, and the x and y directions represent the image height and width directions, respectively. (2) Assume that the x and y direction indices of each slice are respectively idx0 , idy0 , idx0 For the x-direction idx0 +1 piece, idy0 For the y-direction idy0 +1 block, then the starting coordinates of the current slice are startPx0 , startPy0 The endpoint coordinates are endPx0 , endPy0 The calculation formula is: ; Where min() is the minimum value; (3) The calculation method for the size of the three-dimensional local block is as follows: ; in, sw and sh These represent the height and width of the three-dimensional local block, respectively.
4. The big data format archiving method according to claim 3, characterized in that, Also includes: The calculation of slice information and 3D local block size corresponding to n-level big data format for each frame of a TB-level biomedical 2D image sequence is as follows: (1) Calculate the height and width of the three-dimensional block corresponding to the Level 1 big data format. h1 , w1 The calculation method is as follows: ; (2) Calculate the number of slices in the x and y directions of each frame of the two-dimensional image corresponding to the Level 1 big data format. nx0 and ny0 The calculation method is as follows: ; in, To round up; (3) Assume that the x and y direction indices of each slice are respectively idx1 , idy1 , idx1 For the x-direction idx1 +1 piece, idy1 For the y-direction idy1 +1 block, then the starting coordinates of the current slice are startPx1 , startPy1 The endpoint coordinates are endPx1 , endPy1 The calculation formula is as follows: ; Where min() is the minimum value; (4) Other levels of big data formats have no redundancy with the level 1 big data format. The corresponding slice information and three-dimensional local block size are calculated using the same parameter calculation method.
5. The big data format archiving method according to claim 1, characterized in that, While compressing each three-dimensional block corresponding to the current level of big data format frame by frame, the maximum value is sampled after two consecutive frames of two-dimensional images are collected in each three-dimensional local block, and finally the three-dimensional local block corresponding to the next level of big data format is generated.
6. The big data format archiving method according to any one of claims 1 to 5, characterized in that, When reading each 3D local block into memory independently, the reading method for each 3D local block is as follows: each frame of the 3D local block is read sequentially, while the data of each frame read is decoded in parallel.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed by a processor, it controls the device where the storage medium is located to perform a big data format archiving method for TB-level biomedical three-dimensional image data as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Rapid data archiving method applicable to three-dimensional brain tissue high-resolution mass atlases
CN104615739A
Moving picture compression apparatus, image processing apparatus, moving picture compression method, image processing method, and data structure of moving picture compression file
US20150229927A1