CN112037183A - 2D SAXS spectrum calculation method and device - Google Patents

2D SAXS spectrum calculation method and device Download PDF

Info

Publication number
CN112037183A
CN112037183A CN202010817053.8A CN202010817053A CN112037183A CN 112037183 A CN112037183 A CN 112037183A CN 202010817053 A CN202010817053 A CN 202010817053A CN 112037183 A CN112037183 A CN 112037183A
Authority
CN
China
Prior art keywords
saxs
map
preset
spectrum
variation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010817053.8A
Other languages
Chinese (zh)
Other versions
CN112037183B (en
Inventor
朱才镇
唐正
刘会超
于佳立
徐坚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen University
Original Assignee
Shenzhen University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen University filed Critical Shenzhen University
Priority to CN202010817053.8A priority Critical patent/CN112037183B/en
Publication of CN112037183A publication Critical patent/CN112037183A/en
Application granted granted Critical
Publication of CN112037183B publication Critical patent/CN112037183B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10056Microscopic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10116X-ray image

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)
  • Analysing Materials By The Use Of Radiation (AREA)

Abstract

The embodiment of the application discloses a method for calculating a two-dimensional small-angle X-ray scattering 2D SAXS spectrum, which comprises the steps of generating a first 2D SAXS spectrum based on a GPU parallel computing technology according to preset distribution parameters, and comparing the variation of the average pixel intensity value of the first 2D SAXS spectrum relative to the average pixel intensity value of the preset 2D SAXS spectrum: when the variation is larger than a preset threshold value, updating the preset 2D SAXS map according to the first 2D SAXS map; when the variation is smaller than or equal to the preset threshold, determining the first 2D SAXS map as a target 2D SAXS map. According to the high-throughput 2D SAXS map calculation method, the pixel intensity value of each pixel point on the 2D SAXS map is calculated simultaneously and parallelly by using a plurality of threads in the GPU, and the calculation speed (second order) of a single 2D SAXS map is greatly improved.

Description

2D SAXS spectrum calculation method and device
Technical Field
The application relates to the technical field of high-performance parallel computing and small-angle X-ray scattering intersection, in particular to a 2D SAXS atlas computing method and device.
Background
Small Angle X-ray Scattering (SAXS) refers to a coherent Scattering phenomenon of electrons to X-rays within a Small Angle range near an original X-ray beam, and spatial geometrical information such as the shape, size, distribution and content of microstructures (including micro-nano particles, pore structures and the like) within a nano-scale (1-1000nm) range in a material can be effectively detected by analyzing X-ray Scattering intensity fluctuation caused by electron density difference between a matrix and the microstructures in a sample. Meanwhile, the SAXS technology has the characteristics of high penetrability, simplicity in sample preparation, nondestructive detection, rapidness in test, good statistics, wide application range and the like, is an indispensable microscopic-mesoscale key analysis characterization means in the current high-throughput characterization technology of the novel material nanoscale microstructure, and is widely applied to various research fields of alloys, suspensions, emulsions, colloids, polymer solutions, natural macromolecules, liquid crystals, films, polyelectrolytes, composites, nanomaterials and the like.
Although some methods are available in the prior art to effectively calculate the theoretical 2D SAXS spectrogram of an anisotropic system, the calculation amount of the theoretical 2D SAXS spectrogram is usually huge, multiple iterations and ensemble averaging are needed to meet statistical requirements, and the calculation speed of a single theoretical 2D SAXS spectrogram can not meet actual research requirements.
Disclosure of Invention
The embodiment of the application provides a method for calculating a two-dimensional small-angle X-ray scattering 2D SAXS spectrum, which comprises the steps of generating a first 2D SAXS spectrum based on a GPU parallel computing technology according to preset distribution parameters, and comparing the variation of the average pixel intensity value of the first 2D SAXS spectrum relative to the average pixel intensity value of the preset 2D SAXS spectrum: when the variation is larger than a preset threshold value, updating the preset 2D SAXS map according to the first 2D SAXS map; when the variation is smaller than or equal to the preset threshold, determining the first 2D SAXS map as a target 2D SAXS map. According to the calculation method, the pixel intensity value of each pixel point on the 2D SAXS map is calculated simultaneously and in parallel by using a plurality of threads in the GPU, so that the calculation speed (second order) of a single 2D SAXS map is greatly improved.
A first aspect of an embodiment of the present application provides a method for calculating a 2D SAXS spectrum, which is applied to an electronic device, where the method for calculating a 2D SAXS spectrum includes: generating a first 2D SAXS map according to preset distribution parameters; calculating a variation of the average pixel intensity value of the first 2D SAXS spectrum with respect to an average pixel intensity value of a preset 2D SAXS spectrum; when the variation is larger than a preset threshold value, updating the preset 2D SAXS map according to the first 2D SAXS map; when the variation is smaller than or equal to the preset threshold, determining the first 2D SAXS map as a target 2D SAXS map.
As can be seen, in this embodiment, the method for calculating the 2D SAXS spectrum generates a first 2D SAXS spectrum based on a GPU parallel calculation technology according to a preset distribution parameter, and then compares a variation amount of an average pixel intensity value of the first 2D SAXS spectrum with respect to an average pixel intensity value of the preset 2D SAXS spectrum, and performs multiple iterations to determine a target 2D SAXS spectrum. According to the method, the pixel intensity values of all pixel points on the 2D SAXS map are calculated simultaneously and parallelly by using a plurality of threads in the GPU, so that the calculation speed of a single 2D SAXS map is greatly increased, and the calculation requirements of massive 2D SAXS maps can be met.
With reference to the first aspect, in one possible embodiment, the method further includes: when the variation is larger than the preset threshold value and after the preset 2D SAXS map is updated, generating a second 2D SAXS map according to the preset distribution parameters; updating image content of the first 2D SAXS atlas to image content of the second 2D SAXS atlas.
With reference to the first aspect, in one possible implementation, the generating the first 2D SAXS map according to the preset distribution parameters includes: determining first model data of N scatterers according to the preset distribution parameters, wherein N is a positive integer; generating the first 2D SAXS map according to the first model data.
With reference to the first aspect, in one possible implementation manner, the generating a second 2D SAXS map according to the preset distribution parameters includes: determining second model data of M scatterers according to the preset distribution parameters, wherein M is a positive integer; generating a second 2D SAXS map according to the second model data.
With reference to the first aspect, in one possible implementation manner, the updating the preset 2D SAXS map includes: adding pixel intensity values of corresponding pixel points on the first 2D SAXS map and the preset 2D SAXS map, and then averaging to obtain the updated preset 2D SAXS map.
With reference to the first aspect, in one possible implementation, the generating the first 2D SAXS map according to the first model data includes: respectively establishing five first matrixes for the shapes, the long axis, the short axis, the zenith angle and the attitude of N scatterers in the first model data, wherein each scatterer in the N scatterers comprises a group of data of the shape, the long axis, the short axis, the zenith angle and the attitude; calculating the first 2D SAXS map according to the five first matrices.
With reference to the first aspect, in one possible implementation, the generating a second 2D SAXS map according to the second model data includes: respectively establishing five second matrixes for the shapes, the long axis, the short axis, the zenith angle and the space azimuth angle of M scatterers in the second model data, wherein each scatterer in the M scatterers comprises a group of data of the shape, the long axis, the short axis, the zenith angle and the space azimuth angle; calculating the second 2D SAXS map according to the five second matrices.
A second aspect of embodiments of the present application provides an apparatus for calculating a 2D SAXS map, including: the generating module is used for generating a first 2D SAXS map according to preset distribution parameters; the calculation module is used for calculating the variation of the average pixel intensity value of the first 2D SAXS map relative to the average pixel intensity value of a preset 2D SAXS map; the updating module is used for updating the preset 2D SAXS map according to the first 2D SAXS map when the variation is larger than a preset threshold value; a determining module, configured to determine that the first 2D SAXS spectrum is a target 2D SAXS spectrum when the variation is less than or equal to the preset threshold.
A third aspect of embodiments of the present application provides an electronic device, including: a processor and a memory; the processor is connected to a memory, wherein the memory is configured to store program code and the processor is configured to invoke the program code to perform the method according to any of the above first aspects.
A fourth aspect of embodiments of the present application provides a computer storage medium storing a computer program comprising program instructions that, when executed by a processor, perform the method according to any one of the first aspects above.
Drawings
The drawings used in the embodiments of the present application are described below.
Fig. 1 is a flowchart of a method for calculating a 2D SAXS spectrum according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of another method for calculating a 2D SAXS map as provided in the examples herein;
FIG. 3 is a schematic structural diagram of an apparatus for calculating a 2D SAXS map according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of another apparatus for calculating a 2D SAXS map according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device for calculating a 2D SAXS map according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides a method and a device for calculating a 2D SAXS spectrum, the method for calculating the 2D SAXS spectrum is used in electronic equipment, and the calculation speed of a single 2D SAXS spectrum can be greatly improved according to the method for calculating the 2D SAXS spectrum.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
Referring to fig. 1, fig. 1 is a flowchart of a method for calculating a 2D SAXS spectrum according to an embodiment of the present application; the method for calculating the 2D SAXS map comprises the following steps:
step S101: determining first model data of N scatterers according to a preset distribution parameter, wherein N is a positive integer.
Specifically, the first model data of the N scatterers is determined according to the preset distribution parameter, wherein the preset distribution parameter is a group of statistical parameters of the N scatterers, including shape, size and angle distribution parameters of the N scatterers, the N scatterers have the same shape, that is, the N scatterers are all ellipsoid, super ellipsoid or other shapes, and the preset distribution parameter is randomly generated from a value range obtained from an experiment according to a random uniform function; the first model data comprises N groups of shape, size and angle values, and the N scatterers correspond to the N groups of shape, size and angle values one to one; and respectively bringing the size and the angle distribution parameters into corresponding distribution functions to obtain N groups of size and angle values, wherein when the shapes of the scatterers are different, the shape functions describing the scatterers are correspondingly different, the N groups of shape values in the first model data are generated from a certain value range of undetermined coefficients in the shape functions corresponding to the N scatterers according to the random uniform distribution function, and the certain value range is obtained according to experiments.
Random in the numerical computation function library NUMPY, or any function of NUMPY and other function libraries with similar functions.
For example, when the N scatterers are in the shape of a hyperellipsoid, the dimensions of the hyperellipsoid include a major axis and a minor axis, and the angles of the hyperellipsoid include a zenith angle and an attitude angle; at this time, the size distribution parameters in the preset distribution parameters include long axis parameters and short axis parameters, the distribution functions corresponding to the long axis parameters and the short axis parameters are lognormal distribution functions, the long axis parameters are substituted into the lognormal distribution functions, the N long axis sizes of the N scatterers are obtained according to the random uniform distribution functions, the short axis parameters are substituted into the lognormal distribution functions, and the N short axis sizes of the N scatterers are obtained according to the random uniform distribution functions; the angle distribution parameters in the preset distribution parameters comprise zenith angle parameters, the distribution function corresponding to the zenith angle distribution parameters is in circular distribution, the zenith angle parameters are substituted into the circular distribution function, and N zenith angle angles of the N scatterers are obtained according to the random uniform distribution function; the numerical values of N space azimuth angles of the N scatterers are obtained according to the random uniform distribution function; describing a shape function of a hyper-ellipsoid as a hyper-ellipsoid function, wherein undetermined coefficients for controlling the specific shape of the hyper-ellipsoid in the hyper-ellipsoid function are a smoothness degree e in the horizontal direction and a smoothness degree N in the vertical direction, and determining N groups of values of e and N of the N scatterers according to the random uniform distribution function; in summary, when the N scatterers are in the shape of a hyper-ellipsoid, the first model data includes N sets of values of the smoothness in the horizontal direction, the smoothness in the vertical direction, the long axis, the short axis, the zenith angle, and the attitude; it is understood that, when the N scatterers have other shapes, the preset distribution parameters and the corresponding first model data obtained by calculation are also different.
The long axis parameters comprise a long axis mean value and a long axis variance, the short axis parameters comprise a short axis mean value and a short axis variance, and the zenith angle parameters comprise a zenith angle mean value and a zenith angle variance.
Step S102: generating a first 2D SAXS map according to the first model data.
Specifically, the first model data is matrixed according to a RESHAPE function or a function similar to the function in a numerical calculation function library NUMPY, that is, five first matrices are respectively established for N groups of shape, major axis size, minor axis size, zenith angle and attitude data in the first model data; converting the numerical types in the five first matrixes into single-precision floating point types according to ASTYPE functions in the numerical calculation function library NUMPY or functions similar to the functions; and copying the single-precision floating point type first matrix stored in the CPU into a GPU memory according to a PYCUDA function or a function similar to the function in the numerical calculation function library NUMPY.
Further, performing two-dimensional Grid (Grid) initialization on all computing units in the GPU, performing two-dimensional Thread Block (Block) initialization on each Grid point, and performing two-dimensional Thread (Thread) initialization on each Thread Block to obtain initialization parameters, wherein the initialization parameters are jointly determined according to the size of a 2DSAXS (digital video analog system) map and the maximum Thread number supported by a single stream processor of the GPU equipment, and the initialization parameters are the number of threads which are simultaneously started when the 2DSAXS map is computed; performing calculation of a pixel value of a single pixel point in the 2D AXS map by using a single thread, and simultaneously calculating the pixel value of each pixel point in the 2D AXS map by using a plurality of threads according to the first matrix converted into a single-precision floating point type, thereby quickly obtaining the first 2D SAXS map, wherein the single thread completes coordinate index of the pixel point corresponding to the single thread according to BLOCKIPX and BLOCKIM functions or other functions similar to the functions in the numerical calculation function library NUMPY; the pixel value of a single pixel point in the 2D SAR atlas is obtained by summing the pixel contribution value of each scatterer in the N scatterers to the pixel point, and the contribution amount of each scatterer in the N scatterers to the pixel intensity of different pixel points in the 2D SAR atlas is determined based on the density distribution or the shape factor of each scatterer.
Step S103: calculating a variation of the average pixel intensity value of the first 2D SAXS map with respect to an average pixel intensity value of a preset 2D SAXS map.
Specifically, the pixel values of the corresponding pixel points calculated by each thread in the GPU are summed (the number of scatterers is summed), and then an average value is obtained, so as to obtain an average pixel intensity value of the first 2D SAXS spectrum, the average pixel intensity value of the preset 2D axs spectrum is calculated by using the GPU, and the average pixel intensity value of the first 2D SAXS spectrum is compared with the average pixel intensity value of the preset 2D SAXS spectrum, so as to obtain a variation of the average pixel intensity value of the first 2D SAXS spectrum relative to the average pixel intensity value of the preset 2D SAXS spectrum.
Wherein, in the first 2D SAXS pattern calculation process, the preset 2D axs pattern may be set to an arbitrary pattern having the same size as the first 2D SAXS pattern.
Step S104: when the variation is larger than a preset threshold value, updating the preset 2D SAXS map according to the first 2D SAXS map.
Specifically, when the variation amount of the average pixel intensity value of the first 2D SAXS spectrum relative to the average pixel intensity value of a preset 2D SAXS spectrum is greater than the preset threshold, the first 2D SAXS spectrum and the pixel values of corresponding pixels on the preset 2D SAXS spectrum are added and averaged, so as to obtain the updated preset 2D axs spectrum.
The preset threshold is one percent or any other value, and is determined by a specific application scenario, which is not specifically limited herein.
Step S105: when the variation is smaller than or equal to the preset threshold, determining the first 2D SAXS map as a target 2D SAXS map.
Specifically, when the variation amount of the average pixel intensity value of the first 2D SAXS spectrum with respect to the average pixel intensity value of a preset 2D SAXS spectrum is less than or equal to the preset threshold, determining the first 2D SAXS spectrum as a target 2D SAXS spectrum.
As can be seen, in this embodiment, the method for calculating the 2D SAXS spectrum generates a first 2D SAXS spectrum based on a GPU parallel calculation technology according to a preset distribution parameter, and then compares a variation amount of an average pixel intensity value of the first 2D SAXS spectrum with respect to an average pixel intensity value of the preset 2D SAXS spectrum, and performs multiple iterations to determine a target 2D SAXS spectrum. According to the method, the pixel intensity values of all pixel points on the 2D SAXS map are calculated simultaneously and parallelly by using a plurality of threads in the GPU, so that the calculation speed of a single 2D SAXS map is greatly increased, and the calculation requirements of massive 2D SAXS maps can be met.
In one possible embodiment, the method further comprises: when the variation is larger than the preset threshold value and after the preset 2D SAXS map is updated, updating the first 2D SAXS map according to the preset distribution parameters.
Specifically, when the variation of the average pixel intensity value of the first 2D SAXS graph relative to the average pixel intensity value of a preset 2D SAXS graph is larger than the preset threshold, and after the preset 2D SAXS graph is updated, second model data of M scatterers are determined according to the preset distribution parameters, the second model data are subjected to matrixing processing to obtain five second matrixes, the second 2D SAXS graph is generated by using GPU multithreading parallel computation according to the five second matrixes, graph content of the second 2D SAXS graph is replaced by graph content of the first 2D SAXS graph, and updating of the first 2D SAXS graph is completed.
The specific acquiring process of the second 2D SAXS spectrum is the same as the acquiring process of the first 2D SAXS spectrum in step S101, and is not described herein again, and M is a positive integer.
Referring to fig. 2, fig. 2 is a flowchart of another method for calculating a 2D SAXS spectrum according to an embodiment of the present application, where the method for calculating a 2D SAXS spectrum includes:
step S201: first model data is obtained.
Specifically, the first model data of the N scatterers is determined according to the preset distribution parameter, wherein the preset distribution parameter is a group of statistical parameters of the N scatterers, including shape, size and angle distribution parameters of the N scatterers, the N scatterers have the same shape, that is, the N scatterers are all ellipsoid, super ellipsoid or other shapes, and the preset distribution parameter is randomly generated from a value range obtained from an experiment according to a random uniform function; the first model data comprises N groups of shape, size and angle values, and the N scatterers correspond to the N groups of shape, size and angle values one to one; and respectively bringing the size and the angle distribution parameters into corresponding distribution functions to obtain N groups of size and angle values, wherein when the shapes of the scatterers are different, the shape functions describing the scatterers are correspondingly different, the N groups of shape values in the model data are generated from a certain value range of undetermined coefficients in the shape functions corresponding to the N scatterers according to the random uniform distribution function, and the certain value range is obtained according to experiments.
Other detailed processes in this step are the same as those in step S101, and are not described herein again.
Step S202: copying the first model data stored in the CPU to the GPU.
Specifically, the first model data is matrixed according to a RESHAPE function or a function similar to the function in a numerical calculation function library NUMPY, that is, five first matrices are respectively established for N groups of shape, major axis size, minor axis size, zenith angle and attitude data in the first model data; converting the numerical types in the five first matrixes into single-precision floating point types according to ASTYPE functions in the numerical calculation function library NUMPY or functions similar to the functions; and copying the single-precision floating point type first matrix stored in the CPU into a GPU memory according to a PYCUDA function or a function similar to the function in the numerical calculation function library NUMPY.
Step S203: and according to the first model data, utilizing a GPU to perform parallel computation, and generating the first 2D SAXS map.
Specifically, performing two-dimensional Grid (Grid) initialization on all computing units in a GPU, performing two-dimensional Thread Block (Block) initialization on each Grid point, and performing two-dimensional Thread (Thread) initialization on each Thread Block to obtain initialization parameters, wherein the initialization parameters are determined jointly according to the size of a 2DSAXS (digital video analog system) map and the maximum Thread number supported by a single stream processor of GPU equipment, and the initialization parameters are the number of threads which are simultaneously started when the 2DSAXS map is computed; performing calculation of a pixel value of a single pixel point in the 2D AXS map by using a single thread, and simultaneously calculating the pixel value of each pixel point in the 2D AXS map by using a plurality of threads according to the first matrix converted into a single-precision floating point type, thereby quickly obtaining the first 2D SAXS map, wherein the single thread completes coordinate index of the pixel point corresponding to the single thread according to BLOCKIPX and BLOCKIM functions or other functions similar to the functions in the numerical calculation function library NUMPY; the pixel value of a single pixel point in the 2D SAR atlas is obtained by summing the pixel contribution value of each scatterer in the N scatterers to the pixel point, and the contribution amount of each scatterer in the N scatterers to the pixel intensity of different pixel points in the 2D SAR atlas is determined based on the density distribution or the shape factor of each scatterer.
Step S204: determining a target 2D SAXS map according to the first 2D SAXS map and the preset 2D SAXS map.
Specifically, calculating a variation of an average pixel intensity value of the first 2D SAXS spectrum relative to an average pixel intensity value of a preset 2D SAXS spectrum, and when the variation of the average pixel intensity value of the first 2D SAXS spectrum relative to the average pixel intensity value of the preset 2D SAXS spectrum is greater than the preset threshold, adding pixel values of corresponding pixels on the first 2D SAXS spectrum and the preset 2D SAXS spectrum, and then averaging to obtain the updated preset 2D axs spectrum; after the updating of the preset 2D SAXS map is finished, repeating steps S201 to S203 to update the first 2D SAXS map according to the preset distribution parameter, where a specific updating process of the first 2D SAXS map refers to the method embodiment shown in fig. 1, and is not described herein again; determining the first 2D SAXS map as a target 2D SAXS map when a variation amount of the average pixel intensity value of the first 2D SAXS map with respect to an average pixel intensity value of a preset 2D SAXS map is less than or equal to the preset threshold.
Step S205: transmitting the target 2D SAXS graph from the GPU back to the CPU.
Specifically, the target 2D SAXS graph obtained through GPU parallel computation and multiple iterations is reversely transmitted back to the CPU device memory from the GPU device memory.
The following details describe the time length required for calculating the target 2D SAXS spectrum under nine different sets of the preset distribution parameters by using the 2D SAXS spectrum calculation method and apparatus in the embodiment of the present application.
(1) When the shape of the scatterer is an ellipsoid, the mean value of the short axis is 18.6nm, the variance of the short axis is 155.3nm, the mean value of the long axis is 196.1nm, the variance of the long axis is 160.6nm, the mean value of the zenith angle is 52.7 degrees, and the variance parameter of the zenith angle is 70.0, the calculation time of a single 512 x 512 pixel 2DSAXS image is 0.41 second.
(2) When the scatterer is in an ellipsoid shape, the mean value of the short axis is 32.3nm, the variance of the short axis is 77.8nm, the mean value of the long axis is 238.3nm, the variance of the long axis is 55.7nm, the mean value of the zenith angle is 68.3 degrees, and the variance parameter of the zenith angle is 17.7, the calculation time of a single SAXS image with 512 pixels by 512 pixels is 0.46 second.
(3) The scatterer is in an ellipsoid shape, the mean value of the short axis is 36.6nm, the variance of the short axis is 195.2nm, the mean value of the long axis is 156.0nm, the variance of the long axis is 50.7nm, the mean value of the zenith angle is 47.2 degrees, and the calculation time of a single SAXS image with 512 pixels by 512 pixels is 0.39 seconds under the condition that the variance parameter of the zenith angle is 24.1.
(4) The scatterer is in an ellipsoid shape, the mean value of the short axis is 17.1nm, the variance of the short axis is 154.0nm, the mean value of the long axis is 155.6nm, the variance of the long axis is 142.5nm, the mean value of the zenith angle is 7.3 degrees, and the calculation time of a single SAXS image with 1024 × 1024 pixels is 1.62 seconds under the condition that the variance parameter of the zenith angle is 56.1.
(5) The scatterer is in an ellipsoid shape, the mean value of the short axis is 30.6nm, the variance of the short axis is 69.3nm, the mean value of the long axis is 190.1nm, the variance of the long axis is 147.2nm, the mean value of the zenith angle is 79.8 degrees, and the calculation time of a single SAXS image with 1024 × 1024 pixels is 1.56 seconds under the condition that the variance parameter of the zenith angle is 29.3.
(6) The scatterer is in an ellipsoid shape, the mean value of the short axis is 31.6nm, the variance of the short axis is 80.4nm, the mean value of the long axis is 218.6nm, the variance of the long axis is 118.6nm, the mean value of the zenith angle is 0.8 degrees, and the calculation time of a single SAXS image with 1024 × 1024 pixels is 1.60 seconds under the condition that the variance parameter of the zenith angle is 24.5.
(7) The scatterer is in an ellipsoid shape, the mean value of a short axis is 14.8nm, the variance of the short axis is 181.7nm, the mean value of a long axis is 243.1nm, the variance of the long axis is 97.7nm, the mean value of a zenith angle is 7.4 degrees, and the calculation time of a single 2048 × 2048 pixel SAXS image is 6.26 seconds under the condition that the variance parameter of the zenith angle is 79.3.
(8) The scatterer is in an ellipsoid shape, the mean value of a short axis is 20.8nm, the variance of the short axis is 137.3nm, the mean value of a long axis is 180.0nm, the variance of the long axis is 65.4nm, the mean value of a zenith angle is 16.4 degrees, and the calculation time of a single 2048 × 2048 pixel SAXS image is 6.19 seconds under the condition that the variance parameter of the zenith angle is 16.3.
(9) The scatterer is in an ellipsoid shape, the mean value of a short axis is 24.0nm, the variance of the short axis is 194.6nm, the mean value of a long axis is 221.2nm, the variance of the long axis is 138.3nm, the mean value of a zenith angle is 64.1 degrees, and the calculation time of a single 2048 × 2048 pixel SAXS image is 6.25 seconds under the condition that the variance parameter of the zenith angle is 79.6.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an apparatus for calculating a 2D SAXS map according to an embodiment of the present disclosure; as shown in fig. 3, the apparatus 300 for calculating a 2D SAXS map includes the following modules.
The generating module 301 is configured to generate a first 2D SAXS spectrum according to a preset distribution parameter;
a calculating module 302, configured to calculate a variation amount of the average pixel intensity value of the first 2D SAXS spectrum relative to an average pixel intensity value of a preset 2D SAXS spectrum;
an updating module 303, configured to update the preset 2D SAXS map according to the first 2D SAXS map when the variation is greater than a preset threshold;
a determining module 304, configured to determine the first 2D SAXS map as a target 2D SAXS map when the variation is smaller than or equal to the preset threshold.
Optionally, as an implementation manner, the updating module 303 is further configured to generate a second 2D SAXS spectrum according to the preset distribution parameter when the variation is larger than the preset threshold and after the preset 2D SAXS spectrum is updated, and update the image content of the first 2D SAXS spectrum to the image content of the second 2D SAXS spectrum.
Optionally, as an implementation manner, the generating module 301 is specifically configured to determine first model data of N scatterers according to the preset distribution parameter, where N is a positive integer; generating the first 2D SAXS map according to the first model data.
Optionally, as an implementation manner, the updating module 303 is specifically configured to determine second model data of M scatterers according to the preset distribution parameter, where M is a positive integer; generating a second 2D SAXS map according to the second model data.
Optionally, as an implementation manner, the updating module 303 is specifically configured to add pixel intensity values of corresponding pixels on the first 2D SAXS spectrum and the preset 2D SAXS spectrum, and then obtain an average value, so as to obtain the updated preset 2D SAXS spectrum.
Optionally, as an implementation manner, the generating module 301 is specifically configured to respectively establish five first matrices for shapes, long axes, short axes, zenith angles, and attitude angles of N scatterers in the first model data, where each scatterer in the N scatterers includes a set of data of a shape, a long axis, a short axis, a zenith angle, and an attitude angle; calculating the first 2D SAXS map according to the five first matrices.
Optionally, as an implementation manner, the generating module 301 is specifically configured to respectively establish five second matrices for shapes, long axes, short axes, zenith angles, and attitude angles of M scatterers in the second model data, where each scatterer in the M scatterers includes a set of data of a shape, a long axis, a short axis, a zenith angle, and an attitude angle; calculating the second 2D SAXS map according to the five second matrices.
It should be noted that, the implementation of the operations of the respective modules in the apparatus 300 may also correspond to the corresponding description in the method embodiment shown in fig. 1.
Referring to fig. 4, fig. 4 is a schematic structural diagram of another apparatus for calculating a 2D SAXS map according to an embodiment of the present disclosure; as shown in fig. 4, the apparatus 400 for calculating a 2D SAXS map includes the following modules.
A model data obtaining module 401, configured to determine the first model data of the N scatterers according to the preset distribution parameter, and determine the second model data of the M scatterers according to the preset distribution parameter, where N and M are positive integers.
A model data forward copy module 402, configured to copy the first model data and the second model data stored in the CPU to the GPU.
And a multithreading parallel computing module 403, configured to generate the first 2D SAXS map according to the first model data and by using GPU for parallel computing.
A target 2D SAXS spectrum determining module 404, configured to determine a target 2D SAXS spectrum according to the first 2D SAXS spectrum and the preset 2D SAXS spectrum.
A target 2D SAXS graph backward pass-back module 405, configured to backward pass back the target 2D SAXS graph from the GPU to the CPU.
It should be noted that, implementation of operations of each module of the apparatus 400 may also correspond to corresponding descriptions in the method embodiment shown in fig. 2, and details are not described here again.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device 500 for calculating a 2D SAXS map according to an embodiment of the present disclosure, and as shown in fig. 5, the electronic device 500 includes a communication interface 501, a processor 502, a memory 503, and at least one communication bus 504 for connecting the communication interface 501, the processor 502, and the memory 503.
The memory 503 includes, but is not limited to, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), or a portable read-only memory (CD-ROM), and the memory 503 is used for related instructions and data.
The communication interface 501 is used for receiving and transmitting data.
The processor 502 may be one or more Central Processing Units (CPUs), and in the case that the processor 502 is one CPU, the CPU may be a single-core CPU or a multi-core CPU.
The processor 502 in the electronic device 500 is configured to read one or more program codes stored in the memory 503, and perform the following operations: generating a first 2D SAXS map based on a GPU parallel computing technology according to preset distribution parameters, and comparing the variation of the average pixel intensity value of the first 2D SAXS map relative to the average pixel intensity value of the preset 2D SAXS map: when the variation is larger than a preset threshold value, updating the preset 2D SAXS map according to the first 2D SAXS map; when the variation is smaller than or equal to the preset threshold, determining the first 2D SAXS map as a target 2D SAXS map.
It should be noted that, implementation of each operation of the electronic device 500 may also correspond to the corresponding description in the method embodiment in fig. 1.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when the computer program runs on a terminal, the method flows shown in the foregoing method embodiments are implemented.
The embodiment of the present application further provides a computer program product, and when the computer program product runs on a terminal, the method flows shown in the foregoing method embodiments are implemented.
It should be understood that the Processor mentioned in the embodiments of the present Application may be a Central Processing Unit (CPU), and may also be other general purpose processors, Digital Signal Processors (DSP), Application Specific Integrated Circuits (ASIC), Field Programmable Gate Arrays (FPGA) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will also be appreciated that the memory referred to in the embodiments of the application may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of example, but not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic random access memory (DDR SDRAM), Enhanced Synchronous SDRAM (ESDRAM), Synchronous link SDRAM (SLDRAM), and Direct Rambus RAM (DR RAM).
It should be noted that when the processor is a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, the memory (memory module) is integrated in the processor.
It should be noted that the memory described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described device embodiments are merely illustrative, and for example, the division of the units is only one type of logical function division, and other division manners may be available in actual implementation, for example, a plurality of units or components may be combined or integrated into another device, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The modules in the device can be merged, divided and deleted according to actual needs.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A two-dimensional small-angle X-ray scattering 2D SAXS spectrum calculation method is applied to electronic equipment, and is characterized in that the 2D SAXS spectrum calculation method comprises the following steps:
generating a first 2D SAXS map according to preset distribution parameters;
calculating a variation of the average pixel intensity value of the first 2D SAXS spectrum with respect to an average pixel intensity value of a preset 2D SAXS spectrum;
when the variation is larger than a preset threshold value, updating the preset 2D SAXS map according to the first 2D SAXS map;
when the variation is smaller than or equal to the preset threshold, determining the first 2D SAXS map as a target 2D SAXS map.
2. The method of claim 1, wherein the computing method further comprises:
when the variation is larger than the preset threshold value and after the preset 2D SAXS map is updated, generating a second 2D SAXS map according to the preset distribution parameters;
updating image content of the first 2D SAXS atlas to image content of the second 2D SAXS atlas.
3. The method of claim 1, wherein generating the first 2D SAXS map according to preset distribution parameters comprises:
determining first model data of N scatterers according to the preset distribution parameters, wherein N is a positive integer;
generating the first 2D SAXS map according to the first model data.
4. The method of claim 2, wherein the generating a second 2D SAXS map according to the preset distribution parameters comprises:
determining second model data of M scatterers according to the preset distribution parameters, wherein M is a positive integer;
generating a second 2D SAXS map according to the second model data.
5. The method according to any of claims 1-3, wherein the updating the preset 2D SAXS map comprises:
adding pixel intensity values of corresponding pixel points on the first 2D SAXS map and the preset 2D SAXS map, and then averaging to obtain the updated preset 2D SAXS map.
6. The method of claim 3, wherein generating the first 2D SAXS atlas from the first model data comprises:
respectively establishing five first matrixes for the shapes, the long axis, the short axis, the zenith angle and the attitude of N scatterers in the first model data, wherein each scatterer in the N scatterers comprises a group of data of the shape, the long axis, the short axis, the zenith angle and the attitude;
calculating the first 2D SAXS map according to the five first matrices.
7. The method of claim 4, wherein generating a second 2D SAXS map from the second model data comprises:
respectively establishing five second matrixes for the shapes, the long axis, the short axis, the zenith angle and the space azimuth angle of M scatterers in the second model data, wherein each scatterer in the M scatterers comprises a group of data of the shape, the long axis, the short axis, the zenith angle and the space azimuth angle;
calculating the second 2D SAXS map according to the five second matrices.
8. An apparatus for computing a 2D SAXS profile, the apparatus comprising:
the generating module is used for generating a first 2D SAXS map according to preset distribution parameters;
the calculation module is used for calculating the variation of the average pixel intensity value of the first 2D SAXS map relative to the average pixel intensity value of a preset 2D SAXS map;
the updating module is used for updating the preset 2D SAXS map according to the first 2D SAXS map when the variation is larger than a preset threshold value;
a determining module, configured to determine that the first 2D SAXS spectrum is a target 2D SAXS spectrum when the variation is less than or equal to the preset threshold.
9. An electronic device, comprising: a processor and a memory;
the processor is coupled to the memory, wherein the memory is configured to store program code and the processor is configured to call the program code to perform the method of any of claims 1-7.
10. A computer storage medium, characterized in that the computer storage medium stores a computer program comprising program instructions which, when executed by the processor, the processor performs the method according to any one of claims 1-7.
CN202010817053.8A 2020-08-12 2020-08-12 2D SAXS map calculation method and device Active CN112037183B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010817053.8A CN112037183B (en) 2020-08-12 2020-08-12 2D SAXS map calculation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010817053.8A CN112037183B (en) 2020-08-12 2020-08-12 2D SAXS map calculation method and device

Publications (2)

Publication Number Publication Date
CN112037183A true CN112037183A (en) 2020-12-04
CN112037183B CN112037183B (en) 2023-07-28

Family

ID=73578096

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010817053.8A Active CN112037183B (en) 2020-08-12 2020-08-12 2D SAXS map calculation method and device

Country Status (1)

Country Link
CN (1) CN112037183B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112579969A (en) * 2020-12-21 2021-03-30 深圳大学 Two-dimensional small-angle X-ray scattering map calculation method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102498168A (en) * 2009-09-18 2012-06-13 旭化成电子材料株式会社 Electrolyte emulsion and process for producing same
CN107590296A (en) * 2016-07-08 2018-01-16 深圳大学 A kind of Full _ pattern fitting method and system of small angle X ray scattering
CN107589133A (en) * 2016-07-08 2018-01-16 中国科学院化学研究所 A kind of method and system that high-performance fiber is analyzed using SAXS
CN107589136A (en) * 2016-07-08 2018-01-16 中国科学院化学研究所 The dual model approximating method and system of a kind of small angle X ray scattering
CN110334731A (en) * 2019-05-09 2019-10-15 云南大学 A kind of the extraction of spatial information method, apparatus and electronic equipment of spectrum picture

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102498168A (en) * 2009-09-18 2012-06-13 旭化成电子材料株式会社 Electrolyte emulsion and process for producing same
CN107590296A (en) * 2016-07-08 2018-01-16 深圳大学 A kind of Full _ pattern fitting method and system of small angle X ray scattering
CN107589133A (en) * 2016-07-08 2018-01-16 中国科学院化学研究所 A kind of method and system that high-performance fiber is analyzed using SAXS
CN107589136A (en) * 2016-07-08 2018-01-16 中国科学院化学研究所 The dual model approximating method and system of a kind of small angle X ray scattering
CN110334731A (en) * 2019-05-09 2019-10-15 云南大学 A kind of the extraction of spatial information method, apparatus and electronic equipment of spectrum picture

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
井敏;谭婷婷;王成国;冯志海;杨云华;: "PAN基碳纤维的微观结构与力学性能相关性分析", 航空材料学报, no. 01, pages 1 - 3 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112579969A (en) * 2020-12-21 2021-03-30 深圳大学 Two-dimensional small-angle X-ray scattering map calculation method and device

Also Published As

Publication number Publication date
CN112037183B (en) 2023-07-28

Similar Documents

Publication Publication Date Title
EP3654293A1 (en) Information processing device and method
CN111783338B (en) Microstructure metal intensity distribution prediction method and device based on artificial intelligence
Krishnan A simple model for electrical charge in globular macromolecules and linear polyelectrolytes in solution
Sander et al. Corrim-based alignment for improved speed in single-particle image processing
Derossi et al. Mimicking 3D food microstructure using limited statistical information from 2D cross-sectional image
Piroli et al. Triviality of quantum trajectories close to a directed percolation transition
Escoda et al. Three‐dimensional morphological modelling of concrete using multiscale Poisson polyhedra
CN112037183A (en) 2D SAXS spectrum calculation method and device
CN112037181B (en) 2D SAXS (three dimensional architecture) atlas analysis model training method and device
Rajabalinia et al. Coupling HAADF-STEM tomography and image reconstruction for the precise characterization of particle morphology of composite polymer latexes
Trampert et al. Exemplar-based inpainting as a solution to the missing wedge problem in electron tomography
CN112579969B (en) Two-dimensional small-angle X-ray scattering map calculation method and device
US20240126950A1 (en) Thermal analysis method, thermal analysis apparatus, and computer program
Combs et al. Fast approximate STEM image simulations from a machine learning model
Roig et al. Particle Size Distributions from Static Light Scattering with Regularized Non‐Negative Least Squares Constraints
Chatterjee et al. Random geometric graph description of connectedness percolation in rod systems
CN107920252B (en) Panoramic video data processing method, device and system
Gabrielli et al. Gravitational force distribution in fractal structures
WO2022258061A1 (en) Point cloud attribute prediction method and apparatus, terminal, and storage medium
Haita Particle-mesh two-dimensional pattern reverse Monte Carlo analysis on filled-gels during uniaxial expansion
Okariz et al. A methodology for finding the optimal iteration number of the SIRT algorithm for quantitative electron tomography
Saseendran et al. Unlocking the potential: analyzing 3D microstructure of small-scale cement samples from space using deep learning
CN105143865B (en) The expansion field iterative reconstruction technique removed for correlated noise(EFIRT)
CN110501704A (en) A kind of complete polarization image polarization decomposing method, apparatus and storage medium
Bouchbinder et al. Statistical physics of fracture surfaces morphology

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant