Fully automatic staining device

The fully automated staining device with pressure-driven flow and machine learning algorithms addresses reagent crystallization and maintenance issues, ensuring precise and efficient reagent application, reducing waste and human error.

WO2026083098A1PCT designated stage Publication Date: 2026-04-23VITRO
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
VITRO
Filing Date
2024-10-19
Publication Date
2026-04-23

AI Technical Summary

Technical Problem

Current automatic staining machines face issues with reagent crystallization, cumbersome maintenance, instability due to non-capillary systems, excessive reagent usage, and lack of precision and automation, leading to inefficiency and increased human error.

Method used

A fully automated staining device using a pressure-driven pumped flow, combined with an air blower, camera, and machine learning algorithms for precise reagent dispensing, inclination sensors, and a robotic arm to ensure accurate and efficient reagent application without user intervention.

Benefits of technology

The device addresses reagent crystallization and maintenance issues, reduces reagent waste, enhances precision, and automates the entire staining process, improving laboratory efficiency and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure IB2024000539_23042026_PF_FP_ABST
    Figure IB2024000539_23042026_PF_FP_ABST
Patent Text Reader

Abstract

An automatic staining device for dispensing staining reagents over one or more biological samples is disclosed. The device utilizes a pressure-driven pumped flow to deliver reagents and comprises a processor in communication with a memory, at least one camera, one or more sample holder supports, reagent vials with movable lids, an air blowing unit, and a robotic arm with at least one dispensing probe. The device is configured to withdraw reagents from the reagent vials, optionally mix them, and dispense the reagents over the sample holders. The air blowing unit is designed to maintain an adequate moisture level on the sample to facilitate further reagent dispensing, determined by an air flow sensor. Preferably the processor, utilizing machine learning models or geometric algorithms, processes images captured by the camera to determine the presence, position, and orientation of sample holders and reagent vials, as well as the open or closed state of vial lids and preferably to read the labels comprised in the sample holders or reagent vials.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] FULLY AUTOMATIC STAINING DEVICE

[0002] Technical field of the invention

[0003] The present invention relates to the field of laboratory automation and sample processing technology, specifically to automated devices for dispensing staining reagents onto biological samples. More particularly, it relates to methods, systems and apparatus for performing histological staining, immunoenzymatic staining and / or hybridisation on tissue sections or cell smears.

[0004] Background of the invention

[0005] The field of biological sample processing, particularly in histology and pathology laboratories, is continuously evolving to enhance efficiency, accuracy, and reliability. Fully automatic staining machines play a crucial role in modern laboratories by automating the application of staining reagents to biological samples. These machines are essential for high-throughput processing, reducing manual labour, minimizing human error, and ensuring consistent staining results, which are vital for accurate diagnosis and research outcomes.

[0006] Current automatic staining machines predominantly rely on capillarity-based mechanisms to deliver reagents to samples. While these systems have introduced a degree of automation, they present several significant drawbacks. The reagents used often contain high concentrations of salts and other substances that tend to crystallize or solidify within the capillary channels. This crystallization necessitates frequent and thorough cleaning to maintain the functionality of the machine. However, in practical laboratory settings — especially in research labs with busy schedules and inexperienced users such as PhD students, or researchers that will be there only temporarily — the meticulous cleaning required is often neglected. This oversight leads to the machines becoming non-functional within months, requiring maintenance and causing downtime and ever-growing expenses.

[0007] Moreover, capillary-based devices are typically closed systems that are complicated to clean. Accessing the internal components for thorough cleaning involves disassembling several parts, which is cumbersome and time-consuming. This complexity discourages users from performing regular maintenance. Additionally, the closed design limits accessibility, making it challenging to monitor and intervene during the staining process if necessary.

[0008] Attempts to develop automatic staining machines without capillarity have aimed to create open systems that are easier to access and clean, thereby avoiding crystallization problems. However, these non-capillary approaches have encountered several challenges. Unlike capillary devices, which are relatively insensitive to the stability and inclination of the machine due to the passive nature of capillary action, non-capillary are affected over the device's stability and angle of operation. Maintaining consistent inclination is critical to ensure uniform reagent distribution.

[0009] Furthermore, non-capillary systems often require significantly more reagent volume to achieve adequate coverage of the samples with respect to capillary systems. This increased usage not only raises operational costs but also presents practical obstacles in handling and disposing of excess reagents. Removing reagents can result in samples becoming too dry, hindering the proper diffusion of subsequent reagents and affecting staining quality. Additionally, some reagents are highly viscous and do not spread easily, leading to uneven staining or the need for the use of excessive reagent quantities to ensure full coverage.

[0010] Another limitation of existing non-capillary automatic staining machines is the lack of precision in reagent dispensing. These devices may dispense reagents over the entire sample holder, wasting valuable reagents, increasing the risk of spills, and heightening the potential for crosscontamination between samples. The inefficiency in reagent usage not only adds unnecessary costs but also complicates waste disposal procedures due to the larger volumes of hazardous materials involved.

[0011] Moreover, current automatic staining devices do not fully automate the entire staining process. Users are often required to manually verify that all reagents and samples are correctly placed and that the system is properly configured before operation. In laboratories processing numerous samples — such as managing 42 samples with 56 different reagents — this manual oversight is prone to errors. Mistakes in reagent placement or sample loading can lead to incorrect staining, wasted resources, and the need for repeat experiments, thereby reducing overall laboratory efficiency.

[0012] There is, therefore, a pressing need for a fully automated, smart staining device that operates without the limitations of capillarity. Such a device should eliminate the issues associated with capillary systems, including reagent crystallization and cumbersome maintenance. It should also address the challenges faced by non-capillary systems, such as the need for excessive reagent volumes, difficulties in removing excess reagents without over-drying samples, and problems with viscous reagents not spreading adequately. The device should ensure precise dispensing of reagents without relying only on covering the full surface of the sample holder, of which the sample occupies only a fraction, minimizing thus waste and reducing the risk of contamination. Additionally, it should automate the full staining process, from the withdrawal of reagents to the mixing and the dispensing, minimizing user intervention and thus the potential for human error. By meeting these needs, the device would significantly improve laboratory efficiency, reduce operational costs, and enhance the reliability of staining results. Summary of the invention

[0013] To overcome the above-mentioned limitations of the staining devices that use capillarity, and that are not completely automated and require user supervision, as well as to tackle the concomitant problems that arise from not using capillarity, herein it is disclosed a smart, fully automated staining device for dispensing staining reagents over one or more biological samples, wherein the reagents are delivered through a pressure-driven pumped flow.

[0014] By using a pumped flow, instead of capillarity, the problems arising from reagent crystallization and continuous and complex maintenance of the automatic staining device is solved. Regarding the issues that arise from not using capillarity, several innovations are herein disclosed that alone or in combination help overcome said challenges. In some embodiments, the automatic staining device comprises an air blower unit which an air blower and an air flow sensor, which makes it possible to regulate the air flow, and therefore this way it is possible to spread the reagent on the sample support, and also to remove excess reagent just until an optimum point of moisture, which allows to continue the staining procedure, as if it the sample or sample holder was left too dry, the new reagents dispensed would present difficulties to spread and distribute over the sample and / or sample holder. Besides, in some preferable embodiments of the invention, the air blower presents a size and positioning in the air exits that allows for an even distribution of the reagent over the sample and / or sample holder.

[0015] For reagents that are particularly viscous, in some preferred embodiments of the invention it is used a spreading element that can mechanically sweep the sample and / or sample holder, mechanically spreading thus the reagent, which also allows to localize the dispensing of the reagent to desired parts of the sample and / or sample holder, such as for example the half, third or quarter of the sample holder wherein the sample is comprised, allowing thus a directed dispensation that reduces the waste of expensive and possibly hazardous reagents.

[0016] Furthermore, to achieve a full automatization, the automatic staining device of the invention comprises a camera that can take pictures of the sample holders and of the reagent vials, allowing to determine, through the use of mathematical algorithms and / or or artificial intelligence, important information necessary to start the process, such as if the sample holders in place and in the correct orientation, read the labels of each sample holder to, for example, determine which reagents need to be dispensed in each sample holder, and furthermore it can determine if said needed reagents are in place, and if the lids are open, which is a vital information to automatically start the process. Not only that, in preferred embodiments of the invention the smart automatic staining device can, through analysing the images taken by the camera with a machine learning algorithm trained to recognize image features, recognize the size and position of the sample in a given sample holder to direct a smart dispensing only over the section of the sample holder comprising the sample, saving thus expensive and potentially hazardous reagents.

[0017] Additionally, in some preferred embodiments of the invention, the disclosed automatic staining device comprises inclination sensors, which can be very useful to determine if the sample holders are completely horizontal, which is of paramount importance in devices that do not use capillarity, and also if the staining device is stable, and the movement of the robotic arm does not cause the whole device to move or lose stability, which again can negatively affect the staining process in these types of devices.

[0018] In a first aspect of the invention, an automatic staining device (1) for dispensing staining reagents over one or more biological samples is disclosed, wherein one or more reagents are delivered through a controlled pressure-driven flow. The automatic staining machine comprises a pressure-driven fluid displacement mechanism, a processor in communication with a memory, at least one camera, one or more sample holder supports suitable to support one or more sample holders, the sample holders preferably comprising at least one biological sample, one or more reagent vials comprising a lid, wherein the lid is movable between an open and a closed state, one air blowing unit comprising an air blower and an air flow sensor, wherein the air blowing unit is configured to remove reagent from the sample and / or sample holders by blowing air over the reagent, preferably one or more mixing vials, and a robotic arm comprising at least one dispensing probe, wherein the dispensing probe is fluidly connected to the pressure-driven fluid displacement mechanism.

[0019] The automatic staining device is further characterized in that the air blowing unit is configured to blow air over the reagent only until a moisture level is left on the sample and / or sample holder adequate to facilitate further reagent dispensing over the sample and / or sample holder. The adequate moisture level is determined based on the flow of air sensed by the air flow sensor. The memory in communication with the processor comprises data representing a set of instructions that, when executed by the processor, cause the processor to receive one or more images taken by one of the at least one camera comprising the image of one or more sample holders, and determine the presence, the position, and / or the orientation of the sample holders based on said images. The determination of the position and / or orientation is made through geometric algorithms or through a first trained machine learning model. The set of instructions further causes the processor to read one or more labels comprised in the image of the one or more sample holders through the first or a second trained machine learning model, wherein said labels comprise at least data relating to a staining procedure.

[0020] The processor is also configured to receive one or more images taken by one of the at least one camera comprising the image of one or more reagent vials and determine the presence of the one or more reagent vials and / or the open or closed state of the lid of said reagent vials based on said images. The determination of the presence of the one or more reagent vials and / or the open or closed state of the lid is made through the first, the second, or a third trained machine learning model. Preferably, the set of instructions causes the processor to read one or more labels comprised in the image of the one or more reagent vials through the first, second, third, or a fourth trained machine learning model, wherein said labels comprise at least data relating to a reagent.

[0021] The dispensing by the dispensing probe comprised in the robotic arm, via a pressure-driven fluid displacement, depends on the determination of the presence, position, and / or orientation of the sample holder and the reading of the one or more labels from the sample holder, and on the determination of the presence and open or closed state of the lid of one or more reagent vials, and optionally from the reading of the one or more labels from the reagent vials.

[0022] In a preferred embodiment of the first aspect of the invention, the automatic staining device further comprises a spreading unit comprising a supporting element and a spreading element, the spreading unit preferably being part of the robotic arm. The longitudinal axis of the spreading element is or can be placed parallel to the surface of the one or more sample holders and / or the surface of the sample holder supports, and the spreading element is supported by a supporting element that can be displaced relative to the spreading element in a direction perpendicular to the longitudinal axis of the spreading element and parallel to the longitudinal axis of the supporting element, between a first configuration wherein the supporting element supports the weight of the spreading element, and a second configuration wherein the spreading element is not supported by the supporting element, such as when it is supported by the sample holder and / or the sample holder support.

[0023] According to a preferred embodiment, the automatic staining device further comprises one or more inclination sensors to detect the inclination of the one or more sample holders with respect to the vertical direction, the gravitational pull or the surface on which they are placed.

[0024] In another preferred embodiment, the sample holder supports comprise a grid of at least 6 apertures to allow excess reagent to flow through instead of accumulating between the sample holder and the sample holder support, preferably comprising at least 9 apertures, more preferably comprising a grid of at least 3x6 apertures, and even more preferably comprising a grid of at least 3x12 apertures.

[0025] According to yet another preferred embodiment, the set of instructions, when executed by the processor, further cause the processor to receive one or more images taken by one of the at least one camera comprising the image of one or more sample holders, which can be the same or different from the images received previously, and provide said one or more images to the first, second, third, or a fourth trained machine learning model, and determine the position and size of the sample in the one or more sample holders based on the output received from the machine learning model. The withdrawal, mixing, and / or dispensing by the automatic staining device further depend on the determination of the position and size of the sample in the one or more sample holders.

[0026] In a preferred embodiment of the first aspect of the invention, the automatic staining device is configured to dispense an amount of reagent proportional to the size of the sample determined, and is further configured to dispense said reagent in a position on the sample holder depending on the position of the sample determined.

[0027] According to another preferred embodiment, the set of instructions, when executed by the processor, further cause the processor to receive one or more images taken by one of the at least one camera comprising the image of one or more mixing vials, provide said one or more images to the first, second, third, fourth, or a fifth trained machine learning model, and determine the presence and position of the one or more mixing vials based on the output received from the machine learning model. The mixing by the automatic staining device depends on the determination of the presence and position of the one or more mixing vials.

[0028] In a preferred embodiment, the automatic staining device is configured such that the longitudinal length of the spreading element is substantially the same as the width of the sample holders and / or sample holder supports, or has a difference in length with said width of ± 25%.

[0029] According to another preferred embodiment, the spreading element is cylindrical and comprises a distal part, a proximal part, and a central part, wherein the diameter of the distal and proximal parts is the same for both the distal and proximal parts and is bigger than the diameter of the central part. The diameter of the distal and proximal parts is between 0.02 and 2 mm longer than the diameter of the central part, preferably between 0.06 and 0.6 mm longer, more preferably between 0.1 and 0.3 mm longer.

[0030] In a further preferred embodiment, the air blower has a shape and orientation adequate to evenly spread the reagents over the sample and / or sample holder, preferably such that the air is blown at an angle between 10 to 80 degrees with respect to the normal to the surface of the sample holder, more preferably between 25 and 65 degrees, even more preferably between 35 and 55 degrees.

[0031] According to a preferred embodiment of the invention, the air blower comprises one or more orifices to blow the air, and the longitudinal axis of the air blower has a length substantially the same as the width of the sample holders and / or sample holder supports, or has a difference in length with said width of ± 25%. If the air blower comprises only one orifice, said orifice is elongated in the direction of the longitudinal axis of the air blower, wherein the maximum length of said orifice is substantially the same as the width of the sample holders and / or sample holder supports, or has a difference in length with said width of ± 25%. If the air blower comprises more than one orifice, said orifices are placed along the longitudinal axis of the air blower, wherein the two most distanced orifices with respect to each other are separated such that at least part of one of the orifices is separated from at least part of the other orifice by a distance substantially the same as the width of the sample holders and / or sample holder supports, or has a difference in length with said width of ± 25%.

[0032] In a preferred embodiment, one of the at least one cameras is comprised in the robotic arm, and the central axis of the lens of said camera presents an inclination angle with respect to the normal axis of the plane of the sample holders and / or sample holder supports of between 10 and 80 degrees, preferably between 25 and 65 degrees, more preferably between 30 and 60 degrees, even more preferably around 45 degrees.

[0033] According to a further preferred embodiment, one of the one or more inclination sensors is configured to detect the inclination of the automatic staining device with respect to the vertical direction, preferably wherein said inclination is detected as a function of time or compared with previous measurements to determine the stability of the automatic staining device.

[0034] In another preferred embodiment, the automatic staining device further comprises a washing receptacle suitable to fit the length of the spreading element.

[0035] Brief description of the drawings

[0036] To enable a better understanding of the present disclosure, and to show how the present disclosure may be carried out, reference will now be made, by way of example only, to the accompanying schematic drawings, wherein:

[0037] Figure 1 shows a drawing of an automatic staining device according to one or more embodiments of the invention.

[0038] Figure 2 shows a drawing of part of the robotic arm of an automatic staining device according to one or more embodiments of the invention, wherein the robotic arm comprises or has attached a camera, a spreading unit and an air blowing unit. Figure 3 shows a drawing of a close up of the spreading unit, wherein the spreading element is shown as a horizontal cylinder, according to one or more embodiments of the invention.

[0039] Figure 4 shows a drawing of an even further close up of the spreading element of the spreading unit according to one or more embodiments of the invention.

[0040] Figures 5 and 6 show a drawing of the part of the robotic arm wherein the the spreading unit and the air blowing unit are attached, and below it is shown a sample holder support with a sample holder on top, according to one or more embodiments of the invention. Figure 5 shows the spreading unit being supported fully by the robotic arm, whereas in Figure 6 it can be appreciated that the air blowing unit has been vertically displaced with respect to the robotic arm when entering into contact with the sample holder, which now supports the weight of the spreading unit.

[0041] Figure 7 discloses a diagram of the steps followed by the processing of the automatic staining device of the invention for an smart or intelligent dispensing, according to one or more embodiments of the invention.

[0042] Figure 8 shows an example of sample holder recognition and image processing for label reading, according to one or more embodiments of the invention.

[0043] Figure 9 shows an example of the image of the lid of a reagent vial and image processing for label reading, according to one or more embodiments of the invention.

[0044] Figure 10 shows a sample holder comprising a grid of apertures, which can be used to calibrate the camera and the image processing, according to one or more embodiments of the invention.

[0045] Figure 11 shows an example of a methodology to determine if the position observed of a sample holder coincides with the expected position or the position of the sample holder support previously calibrated, according to one or more embodiments of the invention.

[0046] Figure 12 shows a drawing of a row of sample holders supports comprising each a sample holder with a label, and a signalling LED, and it is further shown a close up of one sample holder support, according to one or more embodiments of the invention.

[0047] Figure 13 shows a drawing of a sample holder rack, comprising 14 columns of sample holders, each one comprising 3 rows of sample holders, according to one or more embodiments of the invention. Figure 14 shows a drawing of a reagent vial rack, comprising 7 columns of 8 rows each of supports for reagent vials, wherein the first and eight row are filled with reagent vials, according to one or more embodiments of the invention.

[0048] Figure 15 shows a drawing of a detail of the robotic arm that comprises the air blowing unit and the spreading unit, according to one or more embodiments of the invention.

[0049] Figure 16 shows a drawing of a close up of an air blower of an air blowing unit, according to one or more embodiments of the invention.

[0050] Figure 17 shows a drawing of a close up of the dispensing probe comprised in the robotic arm, according to one or more embodiments of the invention.

[0051] Figure 18 shows a close up of a reagent vial with the lid open according to one or more embodiments of the invention.

[0052] Figure 19 shows a washing station according to one or more embodiments of the invention.

[0053] Description of the invention

[0054] Definitions

[0055] As used herein, “a” or “an” means “at least one” or “one or more.”

[0056] It is noted that the term “about”, if used herein, refers to + / - 30%, preferably + / - 20%, preferably + / - 15%, more preferably + / - 10%, of the indicated referred value. It may also refer to the exact value, that is, + / - 0% or + / - the standard measurement error. Also, any quantity, composition percentages and / or dimension mentioned herein is understood to present an error of + / - 30%, preferably + / - 20%, preferably + / - 15%, more preferably + / - 10%, more preferably + / - 5% or + / - 0% of the indicated value. It may also refer to the exact value, that is, + / - 0% or + / - the standard measurement error.

[0057] As used herein, the conjunctive term "and / or" between multiple recited elements is understood as encompassing both individual and combined options. For instance, where two elements are conjoined by "and / or", a first option refers to the applicability of the first element without the second. A second option refers to the applicability of the second element without the first. A third option refers to the applicability of the first and second elements together.

[0058] When used herein the term "comprising" can be substituted with the term "containing" or "including" or sometimes when used herein with the term "having". When used herein "consisting of' excludes any element, step, or ingredient not specified in the claim element. When used herein, "consisting essentially of” does not exclude materials or steps that do not materially affect the basic and novel characteristics of the claim.

[0059] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as is commonly understood by one of ordinary skill in the art to which this invention belongs. All patents, applications, published applications and other publications referred to herein are incorporated by reference in their entirety. If a definition set forth in this section is contrary to or otherwise inconsistent with a definition set forth in applications, published applications and other publications that are herein incorporated by reference, the definition set forth in this section prevails over the definition that is incorporated herein by reference.

[0060] The term "staining reagents", in the context of the invention, refers to any chemical substances or mixtures used to stain biological samples, including but not limited to dyes, antibodies, enzymes, or hybridization reagents. These reagents are applied to biological samples such as tissue sections, cell smears, or other biological materials in order to highlight or differentiate structures for observation under a microscope. Staining may include histological staining, immunoenzymatic staining, and hybridization techniques, and is employed for diagnosing diseases, conducting research, and other scientific analyses.

[0061] The term "pressure-driven pumped flow", in the context of the invention, refers to the mechanism by which reagents are transported and dispensed over biological samples, utilizing a pump to create a controlled flow of liquid. This flow is driven by pressure exerted by the pump, which may include, but is not limited to, piston-based pumps, syringe-type pumps, peristaltic pumps, diaphragm pumps, or any similar mechanism that displaces fluid. Unlike capillary flow, which relies on passive forces within narrow tubes, a pressure-driven pumped flow ensures consistent and directed movement of reagents, allowing for precise application and control.

[0062] The term "sample holder supports", in the context of the invention, refers to the structural components designed to support and / or hold sample holders during the staining process. These supports may include features such as orifices or grids that allow excess reagent to flow through, preventing fluid accumulation between the sample holders and the support structure. In some embodiments, the sample holder supports may also comprise additional components such as inclination sensors to monitor and adjust the position of the samples, or temperature control units to regulate the environment during staining.

[0063] The term "sample holders", in the context of the invention, refers to the structures used to contain and position biological samples during the staining process. These may include, but are not limited to, glass slides, well plates, or other substrates suitable for holding biological specimens such as tissue sections or cell smears. The sample holders preferably comprise a label or handwritten notations indicating information regarding the reagents or the staining procedure that needs to be applied over the sample comprised in the sample holder.

[0064] The term "biological sample", in the context of the invention, refers to any material of biological origin that is intended to be stained for diagnostic, research, or analytical purposes. This may include tissue sections, cell smears, cytology samples, or other biological materials that require staining for enhanced visualization. The biological samples are typically prepared on sample holders and may undergo various types of staining processes to highlight cellular structures, proteins, nucleic acids, or other biological components.

[0065] The term "reagent vials", in the context of the invention, refers to containers designed to hold the staining reagents used in the automatic staining process. These vials are preferably equipped with a lid that can be moved between an open and closed state, allowing the withdrawal or dispensing probe to access the reagent inside when in the open state, and preventing it in the closed state. In some embodiments, the system may detect the open or closed status of the lid to ensure that the process only begins when the lid is open, optionally providing an alert or prompt to the user otherwise. In other embodiments, the vials may be equipped with a membrane that allows the probe to pass through without the need to open the lid, therefore not needing the feature to detect the open and closed status and ensuring a continuous and automated process without manual intervention.

[0066] The term "air blower", in the context of the invention, refers to a device designed to direct airflow over a biological sample or sample holder, preferably to remove excess reagent either by drying it and / or by displacing it outside the boundaries of the sample holder. The air blower may comprise one or more orifices through which the air is blown, may comprise an angled air exit to direct the air towards the sample and sample holder at an angle in between the horizontal and vertical directions, more preferably between 30 and 60 degrees with respect to the vertical direction. The air blower is preferably shaped and configured to blow air over the entire width of the sample holder, more preferably in a substantially evenly way.

[0067] The term "air flow sensor", in the context of the invention, refers to a sensor that measures and allows to regulate the flow of air generated by the air blower. This sensor preferably allows for the detection of the quantity and / or speed of air being blown, and the controller or processor receiving the information from the air flow sensor can calibrate the distance of the ait blower with respect to the sample holder, and the duration of the airflow to determine the dryness or moisture level of the sample holder. The term "mixing vials", in the context of the invention, refers to containers used for mixing two or more reagents prior to their application onto biological samples. These vials allow the preparation of custom or pre-programmed reagent combinations in an automated manner to ensure the correct formulation is dispensed during the staining process.

[0068] The term "fluid pump", in the context of the invention, refers to a mechanism used to create pressure-driven flow for the transport of reagents from the reagent vials to the dispensing probe and ultimately onto the biological samples. This pump may include various types of pumps, such as syringe pumps, peristaltic pumps, or diaphragm pumps, that enable precise control of reagent flow during withdrawal, mixing, and dispensing operations.

[0069] The term "moisture level", in the context of the invention, refers to the amount of liquid remaining on the surface of the biological sample or sample holder after reagent application and subsequent removal by the air blower and / or the spreading element. An optimal moisture level allows the next reagent to spread easily over the sample surface, while a sample that is too dry can hinder the proper distribution of additional reagents, potentially affecting the quality of the staining process.

[0070] The term "dispensing probe", in the context of the invention, refers to the component responsible for transferring reagents from the reagent vials to the sample holders. In some embodiments, the dispensing probe is capable of both withdrawing reagents from the vials and dispensing them over the samples, enabling a dual function in reagent handling, whereas in other embodiments may be fluidly connected to a withdrawal probe that carries on the function of withdrawing the reagents and providing them to the dispensing probe. The dispensing probe is preferably fluidly connected to the fluid pump which ensures accurate and controlled reagent application.

[0071] The term "trained machine learning model", in the context of the invention, refers to a computational model that has been trained using datasets of images or other relevant data to perform tasks such as identifying the presence, position, orientation, and size of sample holders and / or reagents, wherein the dataset of images preferably comprises labelled images used fortraining of the different possibilities that can be found (such as images of reagent vials open and closed, different positions and orientations of the sample holders, etc) and also test images to determine the accuracy of the model. The model or models can thus be trained to recognize specific labels or conditions, such as the open or closed state of reagent vials, based on the input provided from the device’s cameras. There may be different models for each task, or a model that is trained to carry out more than one task, and / or multimodal models that can receive different types of input at the same time, or different types of images. The term "open or closed state of the lid", in the context of the invention, refers to the status of the lid covering the reagent vials, indicating whether the lid is in a position that allows access for the dispensing probe to withdraw reagents (open) or not (closed). The system may detect the open or closed state to either proceed with or pause the staining process. In some embodiments, the lid may be equipped with a membrane that permits the probe to pass through without needing to open the lid, therefore not needing the system to determine such state.

[0072] The term "supporting element", in the context of the invention, refers to a component of the spreading unit that supports the spreading element. The supporting element can be displaced relative to the spreading element when the spreading element is in contact with the sample holder. This displacement prevents excessive pressure from being applied to the sample holder, reducing the risk of damaging or breaking the sample holder during the reagent spreading process.

[0073] The term "spreading element", in the context of the invention, refers to the part of the spreading unit responsible for distributing reagents over the surface of the sample or sample holder. The spreading element is preferably cylindrical, with a central part having a smaller diameter than the distal and proximal parts, allowing the central part to spread an even and uniform layer of reagent — preferably around 0.1 mm — while the distal and proximal parts rest on the edges of the sample holder. However, other configurations are possible as long as they have a similar functionality, such as a flange with a central part with a smaller length, a prism, or even a cylinder that has a bevel or a transverse section parallel to the longitudinal axis of the cylinder.

[0074] The term "inclination sensors", in the context of the invention, refers to sensors that detect the angle or tilt of the sample holder supports, or the automatic staining device or its components with respect to the vertical or horizontal plane. These sensors may include, but are not limited to, accelerometers, tilt sensors, inclinometers, gyroscopes, inertial measurement units (IM Us), angle sensors, orientation sensors, or gravitational sensors. Inclination sensors ensure the proper alignment of the sample holders during the staining process, greatly improving consistency in reagent application.

[0075] Description

[0076] The main challenges faced by current automatic staining devices, particularly those relying on capillarity-based systems, revolve around frequent maintenance due to reagent crystallization, cumbersome cleaning processes, and the difficulty in accessing internal components. Noncapillary alternatives, while attempting to resolve these issues, introduce new problems, such as the excessive sensibility to instabilities and inclination, increased reagent consumption, and the difficulty in handling viscous reagents. Current devices also often lack full automatization and precision in reagent dispensing, leading to wasted materials and increased risk of contamination, while still requiring significant user intervention for configuration and verification, which introduces the potential for human error. There is a need for a fully automated, smart staining device that eliminates the issues associated with capillarity, controls reagent usage efficiently, ensures uniform reagent application, and automates the entire process, significantly reducing user intervention and errors.

[0077] In this invention we disclose a device that addresses the aforementioned issues and successfully solves them.

[0078] Each embodiment disclosed herein is contemplated as being applicable to each of the other disclosed embodiments. Thus, all combinations of the various elements described herein are within the scope of the invention. It should also be understood that, unless clearly indicated to the contrary, in any methods claimed herein that include more than one step or act, the order of the steps or acts of the method is not necessarily limited to the order in which the steps or acts of the method are recited.

[0079] In a first aspect of the invention, an automatic staining device (1) for dispensing staining reagents over one or more biological samples is disclosed. Contrary to devices that use a capillary flow, in the device (1) of the invention one or more reagents are delivered through a controlled pressure-driven flow, since the automatic staining device (1) comprises a pressure- driven fluid displacement mechanism. The controlled pressure-driven flow enables precise and efficient reagent delivery, addressing the problems of reagent crystallization and the maintenance complexities seen in capillary-based systems.

[0080] In some embodiments, the pressure-driven fluid displacement mechanism may comprise various types of devices that manage fluid flow through the application of pressure. This may comprise a motorized syringe, where a motor controls the movement of the syringe plunger, thereby regulating the flow rate and volume of the reagent being dispensed. This is particularly useful when dealing with viscous reagents or when precise reagent volumes are needed to avoid reagent wastage or over-application. Another possibility is the use of a peristaltic pump, in which fluid is propelled through flexible tubing by compressive rollers, enabling smooth, continuous flow without the risk of backflow and ensuring the reagent remains uncontaminated by the pump system itself. In some embodiments both types of pressure-driven fluid displacement mechanisms may be employed, for example for different reagents. A pneumatic pump may alternatively be used, wherein compressed air displaces the reagent from a reservoir towards the dispensing probe. Other options compirse a diaphragm pump, wherein the displacement of the reagent is achieved by the flexing of a diaphragm, creating the necessary pressure to move the fluid.

[0081] The controlled pressure-driven flow may be applicable to a wide variety of staining procedures, including but not limited to histological staining, immunoenzymatic staining, hybridization techniques, and / or cytological staining. For histological staining, the device may be used for procedures such as Hematoxylin and Eosin staining, Masson’s trichrome staining, or periodic acid-Schiff staining, which are commonly employed to visualize cellular structures in tissue sections. In the case of immunoenzymatic staining, the device may be configured to handle staining processes such as immunohistochemistry or enzyme-linked immunosorbent assays, where antigen-antibody reactions are used to visualize specific proteins or markers within cells or tissues. The device may further support hybridization techniques, such as in situ hybridization, where specific DNA or RNA sequences are detected in cells or tissues. Additionally, the device may be suitable for cytological staining, such as the Papanicolaou staining process used to stain cell smears and detect cellular abnormalities.

[0082] It is further noted that the device (1) may be configured to dispense reagents onto a variety of biological samples, including tissue sections, cell smears, and other biological materials. The pressure-driven fluid displacement mechanism may also be controlled by a processor to dynamically adjust flow rate, volume, and pressure based on the specific reagent, sample size, or staining protocol in use.

[0083] In some embodiments, the pressure control system may be equipped with sensors that monitor the pressure within the fluid displacement mechanism, ensuring precise control during the reagent dispensing process. Sensors such as pressure transducers or flow sensors may be employed to adjust pressure in real-time, preventing over-pressurization or clogging. Furthermore, the fluid displacement mechanism may be configured to handle reagents of varying viscosities, offering flexibility in the types of reagents that can be used during the staining procedure.

[0084] The automatic staining device (1) further comprises a processor in communication with a memory. The processor can manage and control various processes involved in the automatic staining procedure. In some embodiments, the processor may be configured to run machine learning algorithms or geometric algorithms to process data, such as images captured by the camera (20), to determine the orientation and placement of sample holders (41) and reagent vials (51). The memory may store staining protocols, image data, or other operational parameters, ensuring that the system can function autonomously and adjust the procedure based on real-time feedback. The processor may also be in communication with various sensors or external control systems, expanding its ability to regulate different parts of the device, such as the fluid displacement mechanism or air blower unit. In alternative embodiments, the processor may support remote connectivity, allowing external devices to upload protocols, monitor the staining process, or intervene manually if necessary.

[0085] The automatic staining device (1) further comprises at least one camera (20). The inclusion of at least one camera (20) is critical for enabling the automated detection of important elements such as the sample holders (41) and reagent vials (51). The camera (20) may capture images or video data, which in some embodiments are processed by the processor to determine whether sample holders (41) are correctly placed, whether reagent vials (51) are present and properly aligned, and / or whether vial lids (52) are in an open or closed state. In some embodiments, the camera (20) may be a high-resolution digital camera, a multi-spectral camera, or an infrared camera, depending on the type of analysis required. Alternatively, multiple cameras may be used, positioned at different angles to ensure full visibility of the working area. The camera (20) may also be equipped with optical zoom or autofocus capabilities to enhance its ability to capture fine details, such as small labels or barcodes on sample holders (41) or reagent vials (51).

[0086] The automatic staining device (1) further comprises one or more sample holder supports (42) suitable to support one or more sample holders (41), the sample holders (41) preferably comprising at least one biological sample.

[0087] The sample holder support (42) is designed to hold one or more sample holders (41), which may contain biological samples, and may comprise orifices, preferably in a grid like configuration, to let the excess reagent through in order to not compromise the stability or position of the sample holder (41), or may comprise grooves, for the same purpose. In some embodiments, the sample holders (41) may be glass slides, as commonly used in laboratory environments for histological or cytological analysis. These glass slides may be labelled, either with handwritten information or printed labels, which provide details about the type of staining procedure, sample identification, or other relevant data. The labels may also comprise barcodes or QR codes, enabling the camera (20) to automatically read and identify the correct staining protocol or reagents needed. In some embodiments the sample holder support (42) may be configured to support other types of sample holders (41) as well, including well plates, Petri dishes, or other container formats depending on the type of biological sample or staining procedure. In some embodiments, the support may be designed to adjust its size or configuration to accommodate different sample holder formats, or to support multiple holders simultaneously for high-throughput analysis. In some embodiments, the sample holder support (42) may also include temperature regulation features, such as heating or cooling elements, to ensure optimal conditions for the biological sample during the staining process. The automatic staining device (1) further comprises one or more reagent vials (51) comprising a lid (52), wherein the lid (52) is movable between an open and a closed state. The reagent vials (51) contain staining reagents that can be dispensed over the biological samples. The reagent vials (51) comprise a lid (52) that is movable between an open and a closed state, preferably moved by the user, but in some embodiments the device may automatically open the lid (52) when needed to access the reagent. In some embodiments, the lid (52) may be motorized or spring-loaded, controlled by the processor to ensure precise timing and opening for reagent withdrawal. Alternatively, the lid (52) may be manually operable or involve mechanical systems such as a sliding or pivoting mechanism. Additionally, the reagent vials (51) may comprise an orifice or outlet port (54), which allows a dispensing probe to enter the vial (51) when the lid (52) is open, facilitating the withdrawal of the reagent without fully removing the lid (52). This configuration helps maintain the integrity of the reagent by minimizing exposure to air or contaminants. The design of the lid (52) may vary depending on the reagent's properties, with options such as screw caps, snap-fit lids, or hinged covers being possible alternatives.

[0088] In some embodiments, the reagent vials (51) may be designed to accommodate different reagent types, including liquid, viscous, or powdered reagents, preferably liquid. They may be made from various materials, such as glass, plastic, or other chemically inert substances, to prevent any adverse reactions with the reagents. The vials (51) may also feature transparent or translucent sections, allowing the user, the camera (20) or other sensors to detect the remaining reagent volume and trigger a refill or alert when levels are low. Alternatively, the vials (51) or the robotic arm (10) may have integrated sensors to monitor reagent levels directly, which can be communicated to the processor for inventory management or process control.

[0089] The automatic staining device (1) further comprises one air blowing unit comprising an air blower (60) and an air flow sensor, wherein the air blowing unit is configured to remove reagent from the sample and / or sample holders by blowing air over said reagent.

[0090] The air blowing unit comprises an air blower (60) and preferably also an air flow sensor, which together allow for the precise regulation of air flow over the reagent dispensed, the sample or sample holders (41). The air blowing unit may be configured to remove excess reagent by either drying the reagent or displacing it out of the sample holder by blowing air or other gases, such as nitrogen or carbon dioxide. The air flow sensor plays a critical role in monitoring the air velocity and adjusting it as necessary to ensure optimal conditions for removing excess reagent without disturbing the sample itself. In some embodiments, the air blower (60) may be positioned at different angles or may feature multiple air outlets to ensure an even distribution of air over the sample, allowing for uniform drying or displacement of the reagent. The air blower may also have adjustable power settings to accommodate different types of reagents or sample conditions, ensuring flexibility in various staining procedures.

[0091] The automatic staining device (1) preferably comprises one or more mixing vials, which, for example, allows providing a dedicated space for mixing different reagents before they are applied to the biological sample. The mixing vials may be fluidly connected to the pressure- driven fluid displacement mechanism, allowing the reagents to be mixed automatically under controlled conditions, or be independent vials. These vials may be made of inert materials, such as glass or plastic, to prevent contamination or reaction with the reagents. In some embodiments, the mixing process may be controlled by the processor, allowing for precise ratios of different reagents to be mixed depending on the staining protocol. The mixing vials may be configured to handle reagents of various viscosities, and they may include sensors to monitor the mixing process, such as optical or viscosity sensors, to ensure homogeneity before dispensing the mixed reagents.

[0092] The automatic staining device (1) further comprise a robotic arm (10) comprising at least one dispensing probe (80), wherein the dispensing probe (80) is fluidly connected to the pressure- driven fluid displacement mechanism. The robotic arm (10) comprises at least one dispensing probe (80), wherein the dispensing probe (80) is fluidly connected to the pressure-driven fluid displacement mechanism. This connection allows the dispensing probe (80), in some embodiments, to withdraw a reagent from a reagent vial (51) and dispense the reagent into a sample, a sample holder (41), or a mixing vial. The robotic arm (10) may be configured to move with multiple degrees of freedom, ensuring precise placement of the dispensing probe (80) over the target area. In some embodiments, the robotic arm (10) may include additional joints, dispensing probes (80 or extendable segments to reach multiple sample holders (41) or reagent vials (51) in a high-throughput system. The movement of the robotic arm (10) can be controlled by the processor, which may use data from the camera (20) or sensors to ensure that the probe is correctly aligned with the reagent vials or sample holders.

[0093] In some embodiments the dispensing probe (80) may further be fluidly connected to at least one reagent withdrawal probe, to streamline the process of withdrawal and dispensing. In an alternative configuration, the dispensing probe (80) may be capable of withdrawing reagents from a reagent vial (51) and then dispensing the same or mixed reagents onto a sample, a sample holder (4!) or into a mixing vial. In some embodiments, the dispensing probe (80) may be interchangeable, or present interchangeable tips or nozzles that can be selected based on the viscosity of the reagent or the size of the dispensing area required. Alternatively, the device may include separate probes for withdrawal and dispensing, depending on the operational requirements or the staining protocols used.

[0094] The automatic staining device (1) may be configured to withdraw one or more reagents from the reagent vials (51), optionally mix two or more reagents in one or more mixing vials, and dispense the withdrawn or mixed reagents over one or more sample holders (41). This flexibility allows for a range of staining protocols to be conducted automatically, with minimal user intervention. In some embodiments, the processor may determine the required reagents for each sample based on data captured by the camera (20) such as the labels on the reagent vials (51) or the sample holders (41), such as the type of sample or the staining protocol associated with the sample. The system may also allow for dynamic adjustments to the mixing or dispensing process, based on real-time feedback from sensors monitoring the sample or reagent conditions.

[0095] Preferably, the automatic staining device (1) or the robotic arm (10) is configured to: withdraw one or more reagents from the one or more reagent vials (51); optionally, mix two or more reagents in the one or more mixing vials; and dispense the one or more withdrawn reagents or the mixed reagents over one or more sample holders (41). This is preferably done with the dispensing probe (80).

[0096] Notably, the automatic staining device (1) is characterized, at least, in that the air blowing unit is further configured to blow air over the reagent only until a moisture level is left on the sample and / or sample holder (41) adequate to facilitate further reagent dispensing over said sample and / or sample holder (41), wherein the adequate moisture level is determined based on the flow of air sensed by the air flow sensor. This moisture level is of great importance to facilitate the proper dispensing and spreading of subsequent reagents over the sample.

[0097] In some embodiments, the adequate moisture level may be determined by the air flow sensor, which monitors the flow of air blown over the reagent and provides feedback to the processor. The system may be configured to previously calibrate this moisture level based on empirical and / or theoretical data or specific staining protocols. For example, the moisture level may be calculated as a function of the air flow sensed by the air flow sensor, and optionally, it may also depend on the time duration of the air blowing. For example, the longer the air is blown, the drier the sample becomes, allowing the processor to modulate the air flow and time accordingly. Additionally, some blowing flow speeds may be best suited for drying the sample, whereas higher ones can be best suited for disperse and distribute the reagent over the sample or sample holder (41). The system may also take into consideration the distance between the air blower and the sample holder (41). In some embodiments, the distance may remain constant during the air blowing process, simplifying the calculation of the moisture level based on flow rate and time. However, in alternative embodiments, the distance between the blower and the sample holder may change dynamically, requiring the processor to adjust the air flow accordingly. For example, if the air blower is positioned farther from the sample holder, it may increase the air flow to compensate for the greater distance, while reducing air flow when closer to the sample to prevent over-drying.

[0098] Additionally, the air blower may move along the length of the sample holder (41) during the air blowing process, ensuring even distribution of air across the entire surface. In some embodiments the blower (60) may rotate or adjust its blowing power to compensate for differences in distance when blowing from the bottom to the top of the sample holder. The movement and rotation may be controlled by the processor to ensure that the reagent is properly dispersed across the sample, avoiding excessive drying or uneven reagent distribution.

[0099] In some embodiments, the air blower (60) may be positioned at an angle relative to the surface of the sample holder (41), or may have a shape or an exiting orifice (63) or slit (64) that is oriented such that the air does not arrive perpendicular to the sample or sample holder (41), but with an angle, preferably the angle, with respect to the normal vector of the plane define by the sample holder (41) i.e., the vertical direction, is between 10° and 90°, preferably between 20 and 80°, more preferably between 30° and 70°, even more preferably between 35° and 60°, even more preferably between 35° and 55°, even more preferably around or equal to 45°. This angular configuration facilitates the dispersion of the reagent across the sample while drying it to the adequate moisture level. In some embodiments the angle may be adjustable depending on the reagent type, the surface area of the sample, or other factors specific to the staining protocol. For example, the blower may be positioned at a 30° to 45° angle with respect to the sample holder, ensuring that the reagent is spread evenly without completely drying out the sample.

[0100] The air blower may also comprise one or more orifices (63) or slits (64), which enable even drying or blowing of air over the sample holder (41). In some embodiments, the blower may include a slit (64) or two or more orifices (63), with the width of the slit (64), or the distance between the most distal orifices (63) with respect to each other selected to provide uniform air distribution over the sample holder (41), at least in the longitudinal direction of the sample holder (41) or over its width. Preferably, the width of the slit or the distance between the most distal orifices is similar to, or within a specific range of, the width of the sample holder (41). This range may be within ±50%, ±25%, or more preferably within ±15% or ±10% of the width of the sample holder, ensuring an even drying process across the entire surface and even distribution or displacement of reagent. This configuration reduces the risk of uneven moisture levels on different parts of the sample holder, which could otherwise interfere with the proper spreading of subsequent reagents.

[0101] The system may also comprise ambient humidity or temperature sensors, which could affect the drying process, and can for example adjust the air blowing process accordingly. For instance, in a high-humidity environment, the blower (60) may need to operate for a longer period to achieve the desired moisture level, while in a dry environment, the blowing time may be reduced.

[0102] In some embodiments in which the air flow sensor is not comprised, then the functionality of blowing air over the reagent only until an adequate moisture level is left on the sample and / or sample holder (41) can still be carried out, with preconfigured and calibrated configurations, for example regarding the duration, distance and speed or power of the blowing.

[0103] In calculating the adequate moisture level, the processor may utilize machine learning algorithms that have been trained on various types of samples and reagents, allowing it to predict the optimal moisture level for each specific scenario. This dynamic adjustment ensures that the system can handle a wide range of staining procedures, from histological to cytological processes, while maintaining the integrity of the samples and minimizing reagent waste.

[0104] In a preferred embodiment of the automatic staining device (1) of the invention, the memory in communication with the processor comprises data representing a set of instructions that when executed by the processor cause the processor to:

[0105] ¡'. receive one or more images taken by one of the at least one camera (20) comprising the image of one or more sample holders (41) and determine the presence, the position and / or the orientation of the sample holders (41) based on said images, wherein the determination of the position and / or orientation is made through geometric algorithms or through a first trained machine learning model, further wherein the set of instructions cause the processor to read one or more labels comprised in the image of the one or more sample holders (41) through the first or a second trained machine learning model, wherein said labels comprise at least data relating to a staining procedure reagents;

[0106] ¡¡'. receive one or more images taken by one of the at least one camera (20) comprising the image of one or more reagent vials (51), and determine the presence of the one or more reagent vials (51) and / or the open or closed state of the lid (52) of said reagent vials based on said images, wherein the determination of the presence of the one or more reagent vials and / or the open or closed state of the lid is made through the first, the second or a third trained machine learning model, preferably wherein the set of instructions cause the processor to read one or more labels comprised in the image of the one or more reagent vials (51) through the first, second, third or a fourth trained machine learning model, wherein said labels comprise at least data relating to a reagent, preferably to the reagent comprised in the corresponding vial (51).

[0107] It is noted that the processor may be configured to receive one or more images captured by the at least one camera (20). The camera images may include visual representations of one or more sample holders (41), and the processor is tasked with determining the presence, position, and / or orientation of these sample holders (41). The position and orientation may be determined using geometric algorithms that analyse key features in the image to calculate relative angles, distances, and alignments. For instance, geometric pattern recognition can compare the edges and corners of the sample holders (41) to predefined templates stored in the memory, ensuring the holders are correctly positioned for the staining procedure. Alternatively, this task may be performed by a trained machine learning model, which has been trained to recognize the orientation and placement of sample holders based on labelled training data. The machine learning model can generalize across different types and sizes of sample holders (41), offering flexibility in real-world applications.

[0108] In addition to detecting the presence and orientation of sample holders (41), the processor is preferably also configured to read labels present in the images. These labels may include human-readable information, such as the pathologist's name, laboratory ID, staining technique, date, or sample copy number. The human-readable portion may be processed through Optical Character Recognition (OCR), enabling the system to interpret text-based data directly from the label. In some cases, the labels may also include a DataMatrix code, which is a machine-readable identifier that stores compressed information, such as the sample ID or both the sample ID and staining technique. The processor may decode the DataMatrix using the same or a separate machine learning model trained to interpret such codes. This dual functionality allows the system to read labels from different sources, whether the label was generated by the staining device itself or by an external system. In scenarios where the label was created by an external system, and includes only the sample ID and technique, the system may automatically register the sample in the device's internal database and associate it with the appropriate staining protocol, reagents, and procedural data, ensuring seamless integration and automation.

[0109] In some embodiments, the processor is capable of receiving images taken by the camera (20) of the reagent vials (51). The processor may determine the presence of reagent vials (51) and assesses whether the lid (52) of each vial is in an open or closed state. This determination may again be made through geometric algorithms that recognize the shape, contours, and relative position of the vial and its lid, identifying whether the lid is open or closed based on its alignment or displacement. Alternatively, a trained machine learning model may be employed to detect more complex variations in the visual appearance of the vials, recognizing whether the lid (52) is fully opened, partially opened, or closed.

[0110] The system may further analyze labels present on the reagent vials (51). These labels, similar to the ones on the sample holders (41), may contain both human-readable data and encoded information in formats like DataMatrix. The human-readable portion may include details such as the reagent ID and an acronym indicating the reagent type. This information may be processed by the same OCR module that handles the labels on the sample holders (41). The encoded DataMatrix, on the other hand, contains more detailed information regarding the reagent vial (51), such as its ID, type, initial volume of reagent, expiration date, batch number, and other critical data for vial management. The system, through a trained machine learning model or a specialized decoding algorithm, extracts this information from the code and may automatically register or update the reagent vial (51) in the device's database, enabling the processor to monitor reagent usage, track reagent expiration, and ensure that the correct reagents are available and ready for the staining procedure.

[0111] In some embodiments, the determination of the presence, position, and orientation of the sample holders (41) and reagent vials (51), as well as the reading of labels, may be distributed among several machine learning models. For instance, a first machine learning model may be responsible for identifying the sample holders (41) and determining their orientation, while a second model focuses on label reading. A third model may handle the detection of the reagent vials (51) and the state of their lids (52), and a fourth model may focus on decoding complex label data, such as batch numbers, expiration dates, and volumes.

[0112] The system may also incorporate a feedback loop, wherein the processor uses the output of the machine learning models to make dynamic adjustments to the staining process. For example, based on the label information, the system may automatically retrieve the necessary reagents, adjust the volume of reagent to be dispensed based on the sample type, or modify the staining protocol depending on the reagent batch or expiration date. Furthermore, the system can flag issues such as missing reagent vials, incorrect sample placement, or misaligned sample holders, alerting the user or adjusting the procedure to correct the issue without manual intervention. It is noted that various types of machine learning algorithms may be employed to achieve these objectives, and the models can be trained and fine-tuned to ensure reliable and accurate performance in diverse environments and with varying data inputs.

[0113] For the task of image analysis, including the determination of the presence, position, and orientation of the sample holders (41) and reagent vials (51), convolutional neural networks (CNNs) are preferably employed. CNNs are highly effective for image classification, object detection, and segmentation, all of which are necessary to distinguish between different components of the device. For example, a CNN can be trained to recognize the contours and edges of a sample holder (41) to determine its orientation and position on the support (42). Similarly, it can detect whether the lid (52) of a reagent vial (51) is open or closed by analysing the geometric and visual features of the vial’s shape and lid alignment.

[0114] The machine learning models may be trained using supervised learning techniques, where labelled datasets of images are provided. These images may depict various scenarios, such as sample holders (41) placed in different orientations, reagent vials (51) with lids (52) in both open and closed states, and labels with different text and barcode formats. The training data could include thousands of images annotated with the correct positions, orientations, lid states, and label contents. The CNN models can then learn from these labelled images by identifying patterns and features that are consistent with the correct annotations.

[0115] To train the models effectively, the data used fortraining and testing may need to be processed and augmented. For example, images can be pre-processed by normalizing the pixel values, adjusting brightness or contrast, and cropping or resizing them to a consistent format. Data augmentation techniques such as random rotations, translations, flips, and zooms can be applied to artificially increase the size and diversity of the training dataset. This helps the model generalize better and perform well under different lighting conditions, sample holder orientations, or camera angles, reducing the risk of overfitting to specific scenarios in the training data.

[0116] The labels read by the processor from the images may involve Optical Character Recognition (OCR) for human-readable text and DataMatrix decoding for machine-readable codes. OCR tasks can be handled by recurrent neural networks (RNNs), particularly long short-term memory (LSTM) networks, which are capable of sequential data processing. LSTMs are effective at recognizing and interpreting the sequence of characters in a label, even if the label is slightly distorted or partially obscured. The DataMatrix decoding may be handled by CNNs or other specialized decoding algorithms, which can identify and extract the compressed information from the barcode-like structure of the DataMatrix. The machine learning models used for label reading (both OCR and DataMatrix decoding) may also be trained on labelled datasets. In the case of human-readable text, the dataset may contain various types of labels with different fonts, sizes, and layouts, annotated with the correct text sequences. For DataMatrix decoding, the training set may contain different DataMatrix codes, each paired with the correct decoded information. The system could be trained to handle different levels of image quality, ensuring that the models can successfully read labels even under suboptimal conditions, such as low resolution or poor lighting.

[0117] The machine learning models may need to be periodically retrained or fine-tuned as new data becomes available, especially if the staining device (1) is deployed in environments with different sample types, labelling systems, or reagent vials. Transfer learning techniques may be employed to fine-tune the models on new datasets without the need for large-scale retraining from scratch. This involves starting with a pre-trained model (on a general dataset of images or text) and fine-tuning it on a smaller, task-specific dataset. Transfer learning significantly reduces the amount of data and computational resources required to achieve accurate performance in new contexts.

[0118] The data used for training and testing may be obtained from various sources, such as preexisting databases of labelled biological sample images, internal databases of images captured during the staining process, or data shared between laboratories using similar systems. The datasets may be enlarged through collaboration with other research institutions or medical facilities, where anonymized data from real-world use cases can be incorporated. Data from different environments (e.g., different lighting conditions, equipment variations) ensures that the models are robust and adaptable to a wide range of practical situations.

[0119] For more complex image recognition tasks, the system may use deep learning models that combine CNNs with LSTMs, forming hybrid architectures. For instance, the CNN could be used to extract spatial features from the image, while the LSTM processes the sequential information (such as the layout of labels, barcodes, or vial arrangements). This combination is especially useful in tasks like reading long text labels or interpreting sequences of reagent vials positioned in a specific order.

[0120] The system may also integrate reinforcement learning algorithms to improve its decisionmaking process. For example, reinforcement learning could be used to optimize the placement of the dispensing probe (870) based on feedback from the staining results. The system could "learn" which adjustments lead to better staining outcomes by continuously analysing images of completed staining processes and correlating them with the procedural adjustments made during reagent dispensing. The performance of the machine learning models may be continuously monitored using metrics like accuracy, precision, recall, and F1 score during testing. The dataset may be split into training, validation, and testing sets to ensure that the models are evaluated on unseen data, preventing overfitting. Cross-validation techniques can also be employed to ensure that the model’s performance is consistent across different subsets of the data.

[0121] It is noted that the dispensing by the dispensing probe (80) comprised in the robotic arm (10), or in the automatic staining device (1), which is performed via a pressure-driven fluid displacement, depends on the determination of the presence, position and / or orientation of the sample holder (41) and the reading of the one or more labels of the sample holders (41), previously processed, and from the determination of the presence and open or closed state of the lid of one or more reagent vials (51) and optionally from the reading of the one or more labels from the reagent vials (51).

[0122] The precise control of this dispensing process is dependent on several critical determinations made by the device, ensuring that the reagent is accurately applied to the sample in the correct position, quantity, and at the appropriate time.

[0123] In some embodiments a relevant factor is the determination of the presence, position, and / or orientation of the sample holder (41). This determination is made based on the images captured by the at least one camera (20) and processed by the processor using either geometric algorithms or machine learning models. These models are capable of recognizing the position and / or orientation of the sample holder (41) on the support (42), ensuring that the dispensing probe (80) aligns correctly with the sample holder (41) to avoid misapplication of the reagent. If the sample holder (41) is misaligned or improperly placed, the system may adjust the position of the robotic arm (10) or, preferably, provide feedback to the user to correct the placement before dispensing begins.

[0124] Another relevant factor for some embodiments is the reading of one or more labels on the sample holders (41). These labels, which may include human-readable text or encoded information such as DataMatrix codes, contain vital data about the staining procedure. The data read from the labels may include the specific staining technique required, the type of sample, and any special handling instructions. This information can be used by the processor to select the correct reagent and determine the optimal amount to dispense. If the label includes information about the type of sample or staining technique, the device can adjust the pressure-driven fluid displacement system to match the reagent’s required volume and flow rate. The label reading process may involve OCR for text and specialized decoding algorithms for barcodes or DataMatrix codes, ensuring the system can interpret both human-readable and machine-readable data. Furthermore, in some embodiments the dispensing process also relies on the determination of the presence and open or closed state of the lid (52) of one or more reagent vials (51). The camera (20) captures images of the reagent vials (51), and the processor analyzes these images to detect whether the vials are correctly placed and whether their lids (52) are open or closed. This alllows that the robotic arm (10) only attempts to withdraw reagent from vials that are available and properly prepared for dispensing. If the lid (52) is detected as closed, the system may either automatically open the lid (52) if the device is configured to do so, or it may issue a prompt for manual intervention. This step prevents errors such as attempting to withdraw reagent from a sealed vial, which could result in system malfunction or contamination.

[0125] Optionally, the system may also perform the reading of one or more labels on the reagent vials (51). These labels may contain information about the reagent, including the reagent type, volume, expiration date, and batch number. This data may be processed by the machine learning models to ensure that the correct reagent is selected for the staining procedure, and that it is within its valid usage period. The reagent vial labels may also include DataMatrix codes or other encoded information that can be decoded to automatically update the system’s inventory or validate the availability of the required reagent for the staining process.

[0126] The integration of these determinations — regarding the sample holder’s (41) position and labels, as well as the reagent vial’s (51) presence, lid state, and labels — facilitates that the pressure-driven fluid displacement system operates efficiently and accurately. The device preferably automatically coordinates these various elements, minimizing the risk of reagent waste, improper staining, or sample contamination. By ensuring that all components are in the correct state before dispensing begins, the device enhances the reliability and automation of the staining process, reducing the need for manual oversight.

[0127] Advantageously, the automatic staining device (1) described herein overcomes the limitations inherent in staining devices that rely on capillarity for reagent distribution. The use of a pressure-driven fluid displacement system, controlled by a processor and supported by advanced Al functionalities, enables precise and efficient reagent dispensing, even in situations where capillary action would be insufficient or problematic. This device eliminates the common issues related to reagent crystallization, uneven reagent distribution, and complex maintenance associated with capillary-based systems. In some embodiments, by automating the detection of sample holders (41), reagent vials (51), and their respective states, the device achieves full automation of the staining process, significantly reducing the need for manual intervention and increasing throughput and accuracy.

[0128] The integration of machine learning models in some embodiments allows for the real-time processing of images captured by the camera (20), ensuring the correct positioning and orientation of sample holders (41), reading of labels, and verification of reagent vials (51) and their lids (52). This results in a highly adaptive system capable of handling a wide range of samples, reagents, and staining protocols with minimal user input. The device automatically adjusts its operations based on the data it receives, ensuring optimal reagent usage and minimizing waste.

[0129] In some embodiments of the device (1) the air blowing unit plays a fundamental role, since is configured to blow air over the reagent until an adequate moisture level remains on the sample holder (41), facilitating further reagent processing. This precise control of moisture is essential in preventing the drying out of the sample, which would hinder the distribution of subsequent reagents. The ability to maintain the sample at the perfect moisture level can be calculated in some embodiments based on real-time data from the air flow sensor, with the processor adjusting the air flow, duration, and angle of the blower to achieve optimal conditions. This controlled drying and dispersing of the reagent evenly across the surface of the sample holder

[0130] (41) allows for consistent, high-quality staining results.

[0131] Furthermore, the air blowing unit, which may present different orifices or slits, is preferably configured or shaped such that the air is evenly dispersed across the sample, addressing another common issue with non-capillary systems — uneven reagent spread. In some embodiments the system may adjust the air blower’s position and power, which coupled with the use of mechanical pumps to control reagent flow, offers unparalleled precision in reagent distribution, achieving uniform coverage across the sample while maintaining the appropriate moisture levels. This leads to improved staining quality, reduced reagent consumption, and a more reliable staining process overall.

[0132] According to a preferred embodiment of the automatic staining device (1) of the invention, the automatic staining device (1) further comprises a spreading unit (30) comprising a supporting element (32) and a spreading element (31), the spreading unit (30) preferably comprised in the robotic arm (10), wherein the longitudinal axis of said spreading element (31) is or can be placed parallel to the surface of the one or more sample holders (41) and / or the surface of the sample holder supports (42), and wherein the spreading element is supported by a supporting element (32) that can be displaced relative to the spreading element (31) in the direction perpendicular to the longitudinal axis of the spreading element (31) and parallel to the longitudinal axis of the supporting element (32), between a first configuration wherein the supporting element (32) supports the weight spreading element (31), and a second configuration wherein the spreading element (31) is not supported by the supporting element (32), such as when is supported by the sample holder (41) and / or the sample holder support

[0133] (42). In some embodiments, the spreading element (31) or the entire spreading unit (30) may be configured to move vertically with respect to the robotic arm (10). This vertical movement is controlled within specific distance limits to prevent unintentional damage to the sample holder (41), particularly when dealing with fragile materials such as glass slides. The vertical tolerance may allow the spreading element (31) to make light contact with the surface of the sample or sample holder (41) without exerting excessive pressure that could cause breakage, as the only force exerted over the sample holder would be its weight would thanks to this vertical movement or tolerance of the spreading element (31) with respect to the robotic arm.

[0134] Additionally, the spreading unit (30) allows for smart, targeted dispensing and distribution of reagents over the portion of the sample holder (41) that contains the biological sample. By positioning the spreading element (31) precisely over the sample area, the device ensures that the reagent is applied efficiently, reducing waste and avoiding unnecessary coverage of areas outside the sample. This targeted approach is particularly beneficial for minimizing the use of expensive or hazardous reagents and for ensuring uniform application directly over the regions of interest on the sample holder (41).

[0135] The spreading element (31) may adopt various shapes, such as a cylinder, flange, or prism, and may rotate or remain stationary depending on the staining protocol. Additionally, the spreading element (31) may have hydrophobic properties to prevent sticking and facilitate even distribution of the reagent across the surface.

[0136] Advantageously, the integration of the spreading unit (30) into the robotic arm (10) allows for mechanical control over the distribution of the reagent across the sample surface, enabling precise application, especially in cases where viscosity or surface tension would otherwise hinder even spreading. The ability to move vertically with controlled tolerance prevents damage to fragile sample holders (41), while ensuring that the spreading element (31) makes sufficient contact to distribute the reagent effectively. Furthermore, the targeted dispensing capability of the spreading unit (30) allows for precise reagent application only to the sample areas, optimizing reagent usage and improving the overall quality and efficiency of the staining process.

[0137] According to a preferred embodiment of the automatic staining device (1), it further comprises one or more inclination sensors to detect the inclination of the one or more sample holders with respect to the vertical direction.

[0138] The term "vertical direction" may refer to what is commonly understood as the absolute vertical direction or be determined relative to the gravitational pull, providing flexibility in defining the reference axis. This inclination detection ensures that the sample holders (41) are properly aligned for the staining process, reducing the risk of uneven reagent distribution due to improper positioning.

[0139] The inclination sensors may include various types of devices, such as accelerometers, tilt sensors, inclinometers, gyroscopes, or orientation sensors. In some embodiments, an inertial measurement unit (IMU) is used, which combines both a three-axis accelerometer and a three- axis gyroscope. The IMU continuously measures both the linear acceleration and angular velocity of the sample holders (41), providing real-time data on their orientation. The inclusion of both accelerometers and gyroscopes ensures that the system can account for dynamic movements, making it suitable for environments where the device may be subject to vibration or slight shifts.

[0140] To mitigate the accumulation of errors typically associated with successive calculations, such as integration from gyroscope data, the system may implement a sensor fusion algorithm. This algorithm combines the angle data from the accelerometer and the angular velocity data from the gyroscope, and uses a statistical confidence model to calculate a more accurate and reliable inclination angle. The result is a robust real-time determination of the sample holder's (41) inclination, with the system updating the angle up to 20 times per second, ensuring precise alignment adjustments during the staining process.

[0141] In other embodiments, alternative sensors may include an angle sensor, which can directly measure the angular position of the sample holders (41) relative to a reference axis, or a gravitational sensor that specifically detects the direction of the gravitational pull to calculate inclination. These alternatives provide flexibility in the design and operation of the device, allowing different sensor configurations to be employed based on the desired level of precision and real-time feedback.

[0142] Advantageously, the inclusion of inclination sensors ensures that the automatic staining device (1) can accurately detect and correct the alignment of the sample holders (41) before and during the staining process. This feature is particularly beneficial in non-capillary systems, where uneven inclination could lead to improper reagent distribution or pooling on one side of the sample holder (41). By using a combination of accelerometer and gyroscope data processed through a sensor fusion algorithm, the system achieves a high level of precision, reducing errors and ensuring consistent staining results. Furthermore, the ability to detect and adjust inclination in real time adds to the overall automation of the device, minimizing the need for manual alignment and ensuring optimal staining conditions for each sample.

[0143] According to a preferred embodiment of the automatic staining device (1) of the invention, the sample holder supports (42) comprises one or more orifices, preferably a grid of at least 6 orifices to let the excess reagent flow through instead of letting the reagent fluid accumulate between the sample holder (41) and the sample holder support (42), preferably comprising at least 9 orifices, more preferably comprising a grid of at least 3x6 orifices, even more preferably comprising a grid of at least 3x12 orifices, allowing sufficient drainage for different types of reagents and sample sizes.

[0144] In addition to providing a path for excess reagent flow, the grid of orifices may also serve a secondary purpose in aiding the calibration of the camera (20) and facilitating the identification of the correct position of the sample holder (41) on the support (42). The grid pattern can create a reference structure that the camera (20) can easily detect, allowing the processor to calculate the sample holder's (41) position and orientation with precision. The regularity of the grid offers distinct visual markers that help the system distinguish between different areas of the sample holder support (42), ensuring that the sample holder (41) is placed accurately for optimal staining results.

[0145] The design of the orifices and the grid itself can be adjusted depending on the specific staining protocols, reagents used, and the size of the sample holders (41). For example, the grid pattern may be expanded or reduced, and the size of the orifices may be adapted to account for the viscosity of the reagents. In some embodiments, the grid may be made of materials that enhance durability, chemical resistance, or cleaning efficiency.

[0146] Advantageously, the inclusion of a grid of orifices in the sample holder support (42) not only prevents the accumulation of excess reagent but also enhances the device’s overall automation and precision. By allowing reagent to flow through the support, the device (1) helps preventing the sample holder (41) to be inclined or be displaced, which is critical when dispensing. Also, it may ensure consistent reagent application and avoids potential interference caused by pooling. The grid also improves the system's ability to calibrate the camera (20) and detect the precise placement of the sample holder (41), contributing to the accuracy of the staining process. This design feature, combined with the flexibility to adjust the number and size of orifices, ensures that the automatic staining device (1) can accommodate a wide range of staining protocols and sample holder configurations, improving both the quality and efficiency of the staining procedure.

[0147] According to a preferred embodiment of the automatic staining device (1) of the invention, wherein the set of instructions, when executed by the processor, further cause the processor to:

[0148] ¡¡¡'. receive one or more images taken by one of the at least one camera (20) comprising the image of one or more sample holders (41), which can be the same or different as the images received in step (¡'), provide said one or more images to the first, the second, the third or a fourth trained machine learning model, and determine the position and size of the sample in the one or more sample holders (41) based on the output received from the machine learning model; wherein the dispensing, and / or the mixing or withdrawal, by the automatic staining device (1) further depends on the determination of the position and size of the sample in the one or more sample holders from step (¡¡¡’).

[0149] The determination of the sample's position and size is crucial for optimizing the reagent usage, especially when working with smaller or irregularly shaped samples. By analyzing the images through the machine learning models, the processor can intelligently adjust the reagent volume and the specific areas where the reagents should be applied. For example, the system may apply more reagent to a larger sample area while avoiding unnecessary application over empty portions of the sample holder (41).

[0150] The trained machine learning models may be designed to recognize various sample types, including tissue sections, cell smears, or other biological specimens. These models may have been trained on a large dataset of labeled images, allowing them to generalize across different staining scenarios, sample holder formats, and sample sizes. Additionally, the models can detect the edges of the sample, determine the boundaries between different regions of interest, and provide output that guides the device's actions during the staining process.

[0151] Advantageously, this embodiment of the automatic staining device (1) significantly enhances the precision and efficiency of reagent dispensing. By usingn machine learning models to determine the exact position and size of the sample in the sample holders (41), the device (1) allows that the reagents are applied only where needed, minimizing reagent waste and reducing the risk of over-application. This intelligent system allows for targeted reagent application, even on small or irregularly shaped samples, ensuring consistent staining quality across all samples. Moreover, the real-time adjustment of the dispensing process based on the sample's size and position further enhances the device's flexibility and automation, enabling it to handle diverse staining protocols and sample types with minimal user intervention.

[0152] According to a preferred embodiment of the automatic staining device (1) of the invention, the automatic staining device (1) is configured to dispense an amount of reagent proportional to the size of the sample determined in step (¡¡¡’), and is further configured to dispense said reagent in a position of the sample holder (41) depending on the position of the sample determined in step (¡¡¡’). This proportional dispensing ensures that the volume of reagent used is precisely matched to the sample's dimensions, optimizing reagent usage and ensuring that only the necessary amount is applied to the sample.

[0153] The configuration allows the automatic staining device (1) to dynamically adjust the reagent volume according to the size of the sample. For smaller samples, the device may dispense a smaller volume of reagent, preventing excess reagent from accumulating on the sample holder (41) and potentially affecting the staining results. For larger samples, the reagent volume is increased accordingly, ensuring thorough and consistent coverage of the entire sample. Additionally, the device dispenses the reagent at the exact location where the sample is positioned, ensuring that the reagent is applied directly over the sample and not in areas of the sample holder (41) that do not contain biological material.

[0154] This precision in both the volume and location of reagent dispensing can be achieved through the integration of the machine learning models that determine the sample’s size and position, combined with the pressure-driven fluid displacement system that controls the reagent flow.

[0155] Advantageously, the ability to dispense a reagent volume proportional to the size of the sample, and in the exact position where the sample is located, greatly improves the efficiency and precision of the staining process in some embodiments. This feature minimizes reagent waste, particularly when using expensive or hazardous reagents, and ensures that the sample is treated evenly, regardless of its size or location on the sample holder (41). Furthermore, this proportional and targeted dispensing helps maintain consistent staining quality across different samples and protocols, contributing to the overall accuracy and automation of the staining device. By adapting the reagent application in real-time, the device achieves superior results in both small and large sample staining applications.

[0156] According to a preferred embodiment of the automatic staining device (1) of the invention, the set of instructions when executed by the processor further cause the processor to: iv' . receive one or more images taken by one of the at least one camera (20) comprising the image of one or more mixing vials, provide said one or more images to the first, the second, the third, the fourth or a fifth trained machine learning model, and determine the presence and position of the one or more mixing vials based on the output received from the machine learning model; wherein the mixing by the automatic staining device (1) depends on the determination in step (iv’) of the presence and position of the one or more mixing vials.

[0157] This, in some embodiments, ensures that the device verifies the correct placement and orientation of the mixing vials before initiating any reagent mixing processes, thereby preventing errors such as missing vials or incorrect vial positioning, which could affect the homogeneity of the reagent mixture or cause operational errors.

[0158] The machine learning models utilized for this task can be trained to detect various vial types, sizes, and positions within the device. These models can recognize mixing vials under different lighting conditions, with varying degrees of occlusion, or in different positions relative to the camera (20). By ensuring that the vials are correctly detected and positioned, the system can precisely control the mixing process, adjusting the timing, volume, and speed of reagent mixing as required by the staining protocol.

[0159] Advantageously, the integration of machine learning models to verify the presence and position of mixing vials enhances the device’s overall automation and reliability. By ensuring that the mixing vials are properly identified and positioned before reagent mixing begins, the device minimizes the risk of procedural errors, such as mixing reagents in an absent or misaligned vial. This level of precision is particularly important when mixing reagents that must be handled with care or in specific proportions, as it guarantees consistent and homogeneous results. Additionally, the use of trained machine learning models to detect vial presence in real-time enables the system to adapt dynamically to different vial configurations, further contributing to the flexibility and robustness of the automatic staining device (1).

[0160] According to a preferred embodiment of the automatic staining device (1) of the invention, longitudinal length of the spreading element is substantially the same as the width (45) of the sample holders (41) and / or sample holder supports (42), or has a difference in length with said width of ± 25%.

[0161] By matching or approximating the width (45) of the sample holder (41), the spreading element (31) can operate effectively across the entire surface without needing excessive movement or repositioning. This proportional sizing reduces the likelihood of missed areas or uneven reagent distribution, which could negatively impact the staining quality. The allowed tolerance of ± 25% ensures flexibility in adapting the spreading element (31) to various sample holder (41) sizes, allowing the device to accommodate different staining procedures and sample formats without requiring significant hardware modifications.

[0162] In some embodiments, the spreading element (31) may feature additional functionalities, such as rotation, adjustable pressure, or specialized surface properties (e.g., hydrophobicity), which work in conjunction with the proportional sizing to optimize the spreading and distribution of reagents.

[0163] Advantageously, the alignment of the spreading element’s (31) length with the width (45) of the sample holders (41) allows that the reagent is applied evenly across the entire sample area, reducing the risk of reagent pooling or insufficient coverage. The proportional length of the spreading element (31) allows for more efficient and quicker reagent application, reducing the time required for each staining procedure. Furthermore, the flexibility provided by the ± 25% tolerance accommodates a variety of sample holder formats and sizes, enhancing the versatility of the automatic staining device (1) and allowing it to function effectively in different laboratory settings and for a range of staining protocols.

[0164] According to a preferred embodiment of the automatic staining device (1) of the invention, the spreading element (31) is cylindrical and comprises a distal part (311), a proximal part (312), and a central part (313), wherein the diameter (D1) of the distal (311) and proximal part (312) is the same for both distal (311) and proximal (312) parts, and is bigger than the diameter (D2) of the central part (313), wherein the diameter (D1) of the distal (311) and proximal (312) parts is between 0.02 and 2 mm longer than the diameter (D2) of the central part (313), preferably is between 0.06 and 0.6 mm longer, more preferably is between 0.1 and 0.3 mm longer.

[0165] This design allows the spreading element (31) to make uniform contact with the sample holder (41) while minimizing excess pressure on the central part (313), which could otherwise lead to uneven reagent distribution or damage to the sample holder (41). The cylindrical shape, with a slight variation in diameter between the central part (313) and the distal and proximal parts (311 , 312), creates a stable spreading action that ensures even reagent application across the entire surface.

[0166] The specific dimensions of the diameter difference allow for precise control over the spreading process, particularly in delicate staining procedures where the reagent must be distributed uniformly and gently. This design helps prevent reagent pooling or incomplete coverage, both of which could negatively affect the staining results.

[0167] Advantageously, the cylindrical design of the spreading element (31), with its differentiated diameters between the distal / proximal parts (311 , 312) and the central part (313), provides precise and even spreading of reagents across the sample holder (41). The controlled diameter variation ensures optimal surface contact without exerting excessive pressure, preventing damage to the sample holder (41) and contributing to high-quality, consistent staining results. Additionally, the range of dimensional tolerance in the diameter difference (D1 and D2) accommodates various reagent viscosities and sample holder surface properties, enhancing the flexibility and reliability of the automatic staining device (1) across different staining protocols and sample types.

[0168] According to a preferred embodiment of the automatic staining device (1) of the invention, the air blower (60) has a shape and orientation adequate to evenly spread the reagents over the sample and / or sample holder (41), preferably such that the air is blowed at an angle between 10 to 80 degrees with respect to the normal to the surface of the sample holder, more preferably between 25 and 65 degrees, even more preferably between 35 and 55.

[0169] This angled airflow allows for the reagent to be spread uniformly across the surface of the sample without causing excessive drying or pooling in specific areas.

[0170] The orientation and shape of the air blower (60) are relevant in controlling the dispersion of the reagent, particularly in cases where precise application is required. Blowing air at an angle allows the airflow to gently push the reagent over the sample’s surface, ensuring even coverage while preventing the reagent from accumulating in one area. The design of the air blower (60) may include specialized nozzles or slits that direct the airflow in a consistent and controlled manner, minimizing turbulence and promoting uniform spreading.

[0171] The the angle of the air blower (60) may be adjusted in some embodiments based on the type of reagent being used, the size and shape of the sample holder (41), and the specific staining protocol. In some embodiments, the air blower (60) may be adjustable, allowing the angle of the air to be dynamically modified during the staining process based on real-time feedback from the processor or sensors monitoring the reagent distribution.

[0172] Advantageously, the design and orientation of the air blower (60) enhance the effectiveness of reagent distribution, ensuring that the reagent is spread evenly across the sample holder (41) without over-drying or causing excess accumulation in localized areas. By ensuring uniform reagent application, the device improves the quality of staining, reduces reagent waste, and minimizes the need for manual adjustments, thus contributing to the full automation and precision of the automatic staining device (1).

[0173] According to a preferred embodiment of the automatic staining device (1) of the invention, the air blower (60) comprises one or more orifices (63) to blow the air, and: a. the longitudinal axis (62) of the air blower has a length (61) substantially the same as the width (45) of the sample holders (41) and / or sample holder supports (42), or has a difference in length with said width of ± 25%; and / or b. if the air blower comprises only one orifice, said orifice is elongated in the direction of the longitudinal axis (62) of the air blower (60), wherein the maximum length of said orifice is substantially the same as the width (45) of the sample holders (41) and / or sample holder supports (42), or has a difference in length with said width of ± 25%; and / or c. if the air blower comprises more than one orifice, said orifices are placed along the longitudinal axis (62) of the air blower (60), wherein the two more distanced orifices with respect to each other are separated such that at least part of one of the orifices is separated from at least part of the other orifice a distance substantially the same as the width (45) of the sample holders (41) and / or sample holder supports (42), or has a difference in length with said width of ± 25%.

[0174] This design ensures that the air blower (60) effectively covers the entire width of the sample holder (41), whether it uses a single elongated orifice or multiple orifices arranged along its longitudinal axis. The precise control over the width and positioning of the orifices allows for uniform air distribution across the surface, improving the overall quality and consistency of the reagent application.

[0175] Advantageously, the inclusion of orifices (63) aligned with the width (45) of the sample holders (41) ensures that the air blower (60) delivers uniform airflow across the entire sample, reducing the risk of uneven reagent drying or pooling. The flexibility of the air blower’s (60) design in different embodiments or comprised at the same time in one embodiment — whether with a single elongated orifice or multiple orifices — allows it to adapt to various sample holder sizes or blowing speeds or powers while maintaining optimal air distribution. This configuration significantly enhances the control over reagent spreading, further contributing to the overall automation and precision of the staining process in the automatic staining device (1). The proportional length of the air blower (60) or the spacing of multiple orifices also ensures that the device can handle a variety of sample holder formats, making it highly adaptable to different laboratory requirements.

[0176] According to a preferred embodiment of the automatic staining device (1) of the invention, one of the at least one cameras (20) is comprised in the robotic arm (10), and the central axis of the lens of said camera presents an inclination angle (21) with respect to the normal axis of the plane of the sample holders and / or sample holder supports of between 10 and 80 degrees, preferably between 25 and 65 degrees, more preferably between 30 and 60 degrees, even more preferably of around 45 degrees.

[0177] This inclined configuration of the camera (20) is preferably designed to minimize reflection when capturing images of the sample holders (41), which are often made of glass slides. Glass surfaces can produce significant glare or reflections when light hits them at certain angles, particularly if the camera lens is positioned perpendicular to the glass surface. By setting the camera (20) at an inclination angle (21), the system avoids direct reflections from the glass, ensuring clearer, more accurate images of the sample and any associated labels or reagents.

[0178] The inclined camera (20) thus enhances the image quality, making it easier for the system to accurately detect the position, orientation, and size of the sample, as well as any reagent distribution or other relevant features on the glass slide. This improved image quality is especially important for the machine learning models used in the device, which rely on clear and detailed visual data to perform their tasks effectively.

[0179] Advantageously, the angled camera setup significantly reduces glare and reflections from the glass surfaces of the sample holders (41), resulting in more reliable and higher-quality images. This ensures that the system can accurately interpret the sample and reagents, improving the precision of the automated staining process. The ability to avoid reflections also allows for more consistent imaging across various lighting conditions, making the device more adaptable and reliable. This configuration improves the overall efficiency and automation of the device, ensuring consistent and accurate results during the staining procedure while minimizing errors due to visual distortions caused by reflections.

[0180] According to a preferred embodiment of the automatic staining device (1) of the invention, one of the one or more inclination sensors is configured to detect the inclination of the automatic staining device (1) with respect to the vertical direction, preferably wherein said inclination is detected as a function of time or compared with previous measurements to determine the stability of the automatic staining device. The term "vertical direction" may refer to the absolute vertical axis or be determined relative to gravitational pull.

[0181] This stability detection is very important to ensure that the sample holders (41) remain securely in place and that the robotic arm (10) can accurately position and dispense reagents without disruption, and for the reagents to be evenly dispersed in the sample holders (41), whereas if there is an inclination this would be impossible. Additionally, any instability in the device could cause the sample holders (41) to shift, which would negatively impact the precise application of reagents and compromise the overall staining process.

[0182] In some embodiments, the inclination sensor, such as an accelerometer, may continuously or punctually measure the gravitational forces acting on the device. The data can be sent to the processor, where a convolutional neural network (CNN) trained on stability patterns preferably processes the information. This CNN model, embedded within the processor, has preferably been trained using data from both stable and unstable scenarios, allowing it to detect, for example, three conditions: stable, unstable, and an intermediate "gray zone" where there is a warning of potential instability, but not yet a need to halt operations.

[0183] By detecting the inclination over time and comparing the data with previous measurements, the system can determine if the automatic staining device (1) is stable, ensuring that the sample holders (41) remain unmoved and the robotic arm (10) performs its tasks without error. If the device detects instability, it can issue warnings or even halt the staining process to prevent reagent misplacement or damage to the samples.

[0184] Advantageously, the ability to monitor and detect the stability of the automatic staining device (1) ensures that the device operates with precision and reliability. The real-time analysis of inclination, combined with the trained CNN, allows the system to proactively identify issues before they impact the staining process. By ensuring that the device remains stable, the automatic staining device (1) prevents errors such as reagent misplacement, sample holder shifts, or robotic arm inaccuracies, all of which could lead to compromised staining quality. This stability monitoring is a key feature in maintaining the overall efficiency and accuracy of the device, especially in environments where vibrations or external forces might otherwise cause instability.

[0185] According to a preferred embodiment of the automatic staining device (1) of the invention, the device (1 ) further comprises a washing receptacle (79) suitable to fit the length of the spreading element. he receptacle may be made from materials that are resistant to chemical wear and compatible with the reagents used in the staining process. Its design ensures that it securely holds the spreading element (31) during washing, minimizing the risk of damage to the element or inadequate cleaning.

[0186] Advantageously, the inclusion of a washing receptacle (79) sized to fit the spreading element (31) ensures that the device can maintain a high level of hygiene and cleanliness, which is important for preventing contamination between samples or reagents. This feature allows for efficient cleaning of the spreading element (31) without manual intervention, thus contributing to the overall automation and reliability of the device. By ensuring that the spreading element (31) is properly cleaned and ready for subsequent use, the washing receptacle (79) enhances the operational efficiency and quality of the staining process, providing consistent results across multiple staining procedures.

[0187] Figures

[0188] To enable a better understanding of the present disclosure, reference will now be made, by way of example only, to the accompanying schematic drawings. It is important to note that the following schematic drawings are provided solely as exemplary, non-limiting potential embodiments of the invention. Accordingly, the drawings are to be regarded as illustrative instead of restrictive, serving merely to aid in the explanation of the invention's principles and potential applications. The figures provided are merely representational and may not be drawn to scale. Certain proportions thereof may be exaggerated, while others may be minimized. The figures are intended to illustrate various implementations of the invention that can be understood and appropriately carried out by those of ordinary skill in the art. Commonly designated elements among the various figures refer to common or equivalent elements in the depicted embodiments. The figures are not intended to be exhaustive or to limit the invention to the precise form disclosed. It should be understood that the invention can be practiced with modification and alteration, and that the invention be limited only by the claims and the equivalents thereof.

[0189] Figure 1 shows a possible embodiment of the automatic staining device (1) of the invention for carrying out treatments of histological staining, immunoenzymatic staining, and / or hybridisation on tissue sections or cell smears. In detail, the device (1) comprises a housing and a cover or lid that can be opened, exposing the staining or hybridisation area comprising the sample holder supports (42) and the sample holders (41), and also the rack (50) with the support (53) for the reagent vials (51), in a horizontal plane, under which a waste tray is located. This allows for an easy access and, if necessary, an easy maintenance. The area is segmented into compartments which are adapted to house sample holders (41) and which act as reaction chambers. A robotic arm (10) carrying an image capture camera (20), preferably high-precision camera, is shown. In a plane below than the staining or hybridisation area, a first reagent area / structure is shown that houses a plurality of common reagent reservoirs. Next to the staining or hybridisation area, a second reagent area / structure is shown which houses a plurality of specific reservoirs (51), as well as a mixing unit and a drying unit.

[0190] The device (1) of Figure 1 can comprise an LED lamp inside the cabin that serves to illuminate the entire work area at the required times (loading of doors, calibration of equipment, etc.), as well as LED lighting placed in the Z axes so that when capturing the image of a sample holder (41), the tissue can be detected without reflection problems. Both lamps can be turned off during the performance of the series to ensure that the technique is not affected by any light. The device (1) of Figure 1 can comprise a humidity and ambient temperature sensor of the cabin that is at the top, a sensor for opening the hood and the locks that prevent it from opening during a series for reasons of safety of the technician and to ensure the correct lighting of the interior during the processes of detection of fabric, reading of codes, etc., as well as a LED strip of the chassis that indicates to the user what state the instrument is in, if it is in process, finished, paused, request to pause or in error.

[0191] The first reagent area / structure is shown housing a plurality of common reagent reservoirs .

[0192] The area is provided with a housing with a plurality of common reagent reservoirs. A common reagent reservoir may comprise at its top, a reservoir plug, and a reagent outlet orifice or bore. At its bottom, the reservoir has a stabilising projection of the common reagent reservoir. Also the means of identifying the reagents and their place of placement in the housing may be comprised in the first area / structure that houses the common reagents, and may further comprise level sensors for each reagent reservoir.

[0193] Figures 12 and 13 show in detail the staining or hybridisation area comprising a rack with a plurality of columns or elongated supports that house, such as 14, in a possible embodiment, and for example three sample holder supports (42) each column, which in turn can house one sample holder (41) each. The column or elongated support, is preferably horizontal, can be inserted or removed from the area independently of the other units. The compartment is shown with a light indicator (44), preferably an LED. The surface of the sample holder support (42) may comprise a plurality or a grid of orifices to let excess reagent to be disposed of, or, may be provided with grooves for the expulsion of excess residues on its upper part, which facilitate the cleaning of the reagents used. The sample holder support, in its lower part, is preferably provided with a heating system / thermal blanket and / or a vibration system to facilitate staining or hybridisation reactions. Preferably, a waste tray that collects waste from the sample holder supports (42) is placed below the staining or hybrydisation area, and can be composed of two parts, an upper part in the form of a grid and a lower part provided with an outlet orifice.

[0194] Figure 14 show in detail a possible embodiment of the support for several removable reagent vials rack (53), which, in its upper part, houses a plurality of specific reagent vials (51), while in its lower part it is provided with a thermostatted heater. Shown in figure 14 are seven of such racks (53), wherein each rack comprises up to 8 reagent vials (51) according to one or more exemplary embodiments shown in figure 14. Each channel of the thermostatted heater can have an optical sensor of the presence of the rack, in such a way that it allows knowing whether or not a rack has been introduced to read only the positions of the vials of the racks that have been detected. The support is segmented into a plurality of racks provided with a gripping portion, the rack housing the specific reagent reservoirs (51), in the embodiment shown, 8 reagent vials (51). The rack can be inserted or removed from the area independently of the rest of the racks by means of the gripping portion. A specific reagent vial (51) is shown in figures 18 and 9 in detail, in which the cap or lid (52) is opened, and it can be seen an outlet port (54) to allow the probe to aspirate specific reagents. Figure 9 further shows an example of image processing for automatic label recognition, wherein the label is spatially transformed to be more readable.

[0195] Figure 19 shows in detail a possible embodiment of the mixing and drying unit (70) housing a washing station (75) of the one or more dispensing probes, preferably of the specific reagent dispensing probe, an automatic reagent mixing unit (77), tubes for the automatic mixing of reagents (76), a drying station (78) of the spreading element (31), and a washing station or receptacle (79) of the spreading element (32). In the rack of specific vials or reservoirs (51), a plurality (n) of vials or reservoirs (51) can be placed, which can be aspirated and dispensed directly into the slides (41) or can be dispensed into the mixing tubes (76) to make mixtures of different specific reagents, since these mixing reagents have several hours of stability and if they were not mixed in situ, they could not be used in the treatments. Additionally, having the possibility of mixing reagents according to the protocols implemented by computer, gives versatility to the apparatus-method-system, since it will not need to have as many reagent racks as needed for the different treatments, allowing from a limited number of reagents, by combination between them, to expand in number and the type of treatments to be applied to the samples.

[0196] Illustratively, different types of mixing reagents are described below, in particular, reagents that when mixed have a stability of between 30 minutes to 24 hours. A planner comprised in the automatic staining device (1), who preferably controls the device (1) of the invention, depending on when he needs the mixing reagent and its stability, will look for the best time to perform the mixing automatically. Preferably, it will carry out the process when the robot is stopped (waiting for incubations, for example) so as not to extend the total time of the series. The mixtures may be of a plurality (n= 2, 3, 4, etc.) of reagents. It should be noted that there is a minimum mixing volume that is limited by the mixing ratio and the minimum dispensing volume of the system. For example, there is a mixture of 2 reagents wherein 25 pl of one is dispensed for each 1000 pl of the other. As the system cannot dispense less than 25 pl, the minimum mixture would be 1025 pl. On the other hand, in a protocol for a slide, 300 pl are used. Once the two reagents are dispensed into the mixing tube, a homogenisation of the mixture is performed. The way to do this is by aspirating and dispensing the volume of the mixed reagent in one of the tubes (26) (in the form of agitation). In a particular embodiment, the mixing tubes (26) are not cooled.

[0197] A possible embodiment of the robotic arm (10) has means for a displacement in the XYZ axes and is provided with a high precision image capture camera (20), disposed at an angle of 45 degrees (see figure 2). The camera is disposed associated with the displacement means in the Z axis, adjacent to the dispensing probe (80), which is shown in detail in figure 17, wherein it is further shown a control element for the probe, and the spreading unit (30), so that the dispensing of reagents, their spreading and the optical evaluation of the sample can be carried out with the same device. The robotic device can be provided with common reagent dispensing comb and air blow drying system (36). The configuration of the invention, integrating a plurality of components in the same element, allows a reduction in the time and energy consumption of the protocol in use.

[0198] According to some embodiments, a common reagent dispensing comb is integrated in the displacement means for the Z axis of the robotic device (10). Preferably, the comb comprises 6 dispensing probes.

[0199] Figure 15 shows in detail the configuration of the spreading unit (30), adjacent to the air blow unit (60), integrated in the displacement means (Z) of the robotic device (10), which allow a reduction in the consumption of time and energy of the protocol in use. Figure 3 shows the spreading element (31) provided with two side portions, referred to as distal and proximal part indistinctly, (312 and 311), and a central part (313), wherein the side portions have the same diameter (D1), which is longer than the diameter (D2) of the central portion. This allows the side portions to rest on the sample holders (41), and when the spreading element (31) combs, or rolls or passes along the length of the sample holder (41) to spread the reagent, there is left over the sample and the sample holder (41) a thin and even layer of reagent, with a thickness approximate to half of the difference of D1 and D2 in length. Preferably the longitudinal length (L2) of the side portions (311 and 312) is much smaller, preferably below a fourth of the longitudinal length (L1) of the spreading element (31). Figure 16 shows in detail the air blowing unit (60), provided with orifices (63) placed along an axis (62) which is preferably parallel to the surface of the sample holders (41), and a slot (64) which preferably has a length equal or similar to the width of the sample holders (41) or +- 25% said with.

[0200] It is noted that a filter for gas removal can be integrated into the apparatus of the invention.

[0201] A possible configuration of components integrated into the displacement means (Z) may comprise, among others, a probe, chamber, comb, blowing system, and electronic component. Figure 33 shows a possible configuration of components integrated in the displacement means (Z) comprising, among others, a probe, roller, comb provided with six dispensing probes, and a blowing system. A possible configuration of components integrated into the displacement means (Z) may comprise, among others, a probe, roller, blowing system, and a temperature monitoring system comprising an infrared (IR) sensor, electronic temperature control board, and connection pins of the electronic board for the IR sensor. These configurations allow a reduction (improvement) in the time and energy consumption of the protocol in use.

[0202] The features described in relation to the apparatus (1) can be integrated and are interchangeable with the components of the system of the invention.

[0203] Figures 5 and 6 show a part of the robotic arm (10) comprising the spreading unit (30) and the air blowing unit (60), which are placed over the proximal end of the sample holder support (42) which supports a sample holder (41) or slide (41), according to one or more embodiments of the invention. It can be appreciated in figure 5 how the spreading unit (30) rests on the supporting piece (33) of the robotic arm (10), therefore the robotic arm (10) holds all the spreading unit (30) weight. However, in figure 6 it can be appreciated how, once the robotic arm has approached vertically the sample holder (41) to situate the spreading unit (30) over said sample holder (41), prior to beginning the spreading of the reagents, the spreading unit

[0204] (30) now has been displaced with respect to the supporting piece (33) of the robotic arm, and the spreading unit (30) rests now over the sample holder (41) due to the spreading element

[0205] (31), or, in particular, the side parts (311 and 312) of the spreading element (31), resting on the sample holder (41), therefore the force applied to the sample holder (41) is only the weight of the spreading unit (30), which is enough to guarantee a correct spreading, but not excessive as to compromise the integrity of the sample holder (41), which typically is made of a thin layer of glass. IT is observed in figure 6, how the spreader support element (32) can slide or traverse the supporting piece (33) of the robotic arm until certain point allowing to move the spreading unit (30) the length of the supporting piece (33) or less, in the vertical axis with respect to the robotic arm, and has a stopper on top to prevent from sliding out.

[0206] Figures 8 to 10 show examples of image processing for reading sample holder (41) labels, reagent vials (51) labels in the case of figures 8 and 9 respectively, and for using the sample holder support (42), and / or the orifice grid, for calibrating the camera in the case of figure 10. Figure 11 show an example of internal processing to determine if the position or orientation of the calculated edges (top, bottom and lateral ones, for example) of a slide or sample holder (41) is in poor, good or excellent agreement with the previously calibrated position or orientation of the calculated edges of the sample holder support (42).

[0207] Figure 7 shows an example of the workflow that can be followed for a smart dispensing, wherein once the camera is calibrated, an image or more of the reagent vials (51) and of the sample holder or slide (41) is taken, then said one or more images are processed to determine the status of the sample holder (41), such us for example the positioning or orientation, or the positioning and size of the sample comprised on the sample holder (41) and of the status of the reagent vials (51), such as for example the presence of vials (51) and open or closed status, as well as reading labels in one or both of the sample holder (41) and the reagent vial (51) to obtain information of the type of reagent or staining procedure that has to be followed, and this processed information is taken in consideration to provide a smart dispensation, preferably a targeted dispensing with respect to the sample, is provided or instead it is paused, and for example a message or alert is prompted to the user, until the status of the sample holder (41) or the reagent vials (51) is the expected or correct one. Methods and examples

[0208] Camera Calibration

[0209] The automatic staining device (1) may employ computer vision techniques to automate the detection, analysis, and interaction with objects such as sample holders (41) and / or reagent vials (51). In some embodiments, the device performs camera calibration using an algebraic method without the use of artificial intelligence. This calibration process preferably involve capturing images wherein the camera's contrast is maximized and the gain is minimized, enhancing the perception of calibration patterns such as beacons with reduced noise. The characteristic points of the beacon or sample holder support (42), such as grids, circles, or squares, are detected within the image. Once these characteristic points are identified, the camera's intrinsic parameters, including but not limited to distortion coefficients and focal length, may be calibrated. The relative position of the camera with respect to the reference frame of the robotic arm is then computed, utilizing intrinsic and extrinsic calibration methods to determine the camera's internal properties and its spatial relationship within the robotic environment. Techniques such as the SolvePnP algorithm and calibration functions are preferably applied to compute these parameters, allowing accurate mapping between image coordinates and the robotic system's coordinate system.

[0210] Detection of Labels and Patterns

[0211] In some embodiments, the device incorporates methods for detecting labels on, for example, sample holders (41) and / or reagent bottles (51), and / or patterns in sample holder supports (42), which are critical for identifying and tracking objects during the staining process. Edge detection techniques, such as the Canny edge detection algorithm, may be utilized to identify the boundaries of labels and beacons within the images. Following edge detection, line detection methods like the Hough Line Transform can be applied to detect straight lines representing, for example, the edges of labels. The detected lines may then be classified into categories, including but not limited to top, bottom, left, and right edges, to identify the four corners of a label or beacon, wherein the sample holder support may be regarded as a beacon, or the pattern of the orifices in the sample holder support may be utilized instead of a label or beacon for recognition. Clustering techniques such as K-means clustering can be employed for this classification, which may involve machine learning to organize the lines geometrically.

[0212] Masking and thresholding techniques are preferably employed to isolate regions of interest, enhancing detection accuracy by highlighting relevant areas and suppressing background noise. An iterative detection process may be implemented, wherein the system continuously adjusts thresholds and detection parameters until the correct bounding box or polygon covering the label is identified. If the label meets certain size criteria and four defining lines around the label can be extracted, the system may conclude that a label is present; otherwise, the process may halt and an error may be logged.

[0213] Calibration and Alignment

[0214] To ensure accurate positioning and manipulation of samples, the device may execute precise alignment between the camera and the robotic system. Coordinate assignment is performed by associating detected image points, such as the corners of sample holders, with real-world coordinates. This allows for accurate mapping between the image plane and the physical workspace of the robotic arm. Error calculation methods can be employed to compute error vectors representing any misalignments between the detected positions and the expected positions. Recalibration may be conducted by projecting two-dimensional image points back into three-dimensional space to correct alignment errors, ensuring that the system maintains high accuracy in sample detection and manipulation over time.

[0215] Affine transformations can be utilized to manipulate images through operations such as scaling, rotation, and translation. These transformations preserve parallelism and ratios of distances, allowing the device to adjust images for better alignment with detected objects or to normalize images for further processing. Affine transformations facilitate consistent analysis despite variations in image orientation or scale, which is essential for accurate detection and positioning of sample holders and labels.

[0216] Additionally, homographic, or projective, transformations can be applied to correct perspective distortions in images, particularly when objects are viewed at an angle. By mapping points from one plane to another, the device can rectify images to present objects, such as labels or beacons, in a frontal view. This correction enhances the accuracy of subsequent image processing tasks by providing a consistent viewpoint, which is crucial for tasks like barcode recognition and precise robotic manipulation.

[0217] Label or Barcode Reading and Validation

[0218] Label or barcode reading and validation may be performed to identify samples and associate them with corresponding data. In some preferred embodiments, the device employs deep learning models for the recognition of barcodes and labels on sample holders (41) and / or reagent bottles (51). Optical Character Recognition (OCR) techniques are preferably utilized to extract textual information from images, even when barcodes or text are partially obscured or of low quality. Machine learning models, such as Long Short-Term Memory (LSTM) networks or convolutional neural networks, may be implemented to enhance accuracy in text recognition, and / or to allow recognition of hand-written text. These models are preferably trained using datasets comprising various barcode and label images, allowing the system to generalize across different formats and conditions. Perspective correction using methods like WarpPerspective() may be applied to adjust the label's perspective, and image sharpening techniques such as applying a convolution filter may enhance the clarity of the barcode and text. The extracted code may be validated against a list of expected sample identifiers for the current batch, and if a match is found, the device proceeds; otherwise, an error may be logged.

[0219] Detection of Reagent Vials and Status Recognition

[0220] In some embodiments Deep learning models are employed for the detection of reagent vials (51) and the determination of their status, such as whether a vial is present and whether it is open or closed. Convolutional neural networks are preferably utilized to analyse images captured by the device's cameras, identifying the presence and state of vials with high accuracy. The models may be trained using image augmentation techniques to increase the available dataset, including but not limited to Gaussian smoothing, sharpening, and random flips, to enhance robustness against variations in imaging conditions.

[0221] In some embodiments, the network architecture may be based on MobileNetV2 for feature extraction, followed by fully connected layers for classification. Activation functions such as the softmax function can be used in the final layer to output class probabilities. The loss function utilized is preferably cross-entropy loss, optimized using algorithms like Stochastic Gradient Descent (SGD) with progressively adjusted learning rates over multiple epochs. Preprocessing techniques may be applied to the images, including dynamic and static data augmentation. Dynamic augmentation involves applying random transformations to image attributes such as brightness, contrast, and saturation during training, enhancing the model's ability to generalize under varying conditions. Static augmentation may include Gaussian smoothing, image sharpening, and cropping.

[0222] A batch size may be selected based on computational resources and dataset size, and validation strategies, such as k-fold cross-validation, are preferably employed to ensure model reliability and generalization. This implementation allows the device to accurately detect vials and their statuses, facilitating automated reagent handling.

[0223] Detection of Tissue Stains via Image Segmentation Techniques

[0224] In some embodiments, the automatic staining device (1) processes images of biological samples to detect tissue stains and prepare for targeted reagent dispensing. Segmentation methods can be applied to separate stained tissue regions from the background. Topological methods, such as Topological Blob Merging and Refinement (TBMR), are preferably utilized to identify connected regions representing tissue.

[0225] In some embodiments geometric filtering is performed to eliminate regions that do not match expected size or shape characteristics, such as regions with high eccentricity or irregular shapes. Clustering techniques, such as K-means clustering, can be employed to classify pixels based on intensity or colour, further refining the segmentation and enhancing the accuracy of tissue detection.

[0226] Once tissue regions are detected, the device preferably approximates these regions into polygons for analysis and processing. Algorithms like the Approximate Polygonal Curve (ApproxPolyDP) method can be used to represent the contours of tissue regions with simplified polygonal shapes. This approximation reduces computational complexity and facilitates the calculation of dispensing strategies by providing a manageable representation of the tissue areas.

[0227] In cases where detected tissue areas are negligible or below a predefined threshold, the device may assume that the entire sample holder (41) is covered with tissue to prevent missing any areas during staining. Perspective adjustments may be applied to align the polygons accurately with the sample holder's coordinate system.

[0228] Image Fusion

[0229] According to some embodiments, the device captures multiple images of the sample holders (41), which are fused to enhance the visibility of relevant regions, such as tissue samples. Image fusion may involve combining regions from images captured under different conditions, such as varying contrast or exposure settings. The fusion process selects key areas from each image and merges them to create a composite image that retains the most informative content from both. Three-dimensional calibration information from the calibration module can be integrated into the image fusion process to ensure proper alignment and accuracy. This integration corrects any distortions or misalignments due to camera angle or positioning, ensuring that the fused image accurately represents the tissue regions on the sample holder. Calibration data also aids in mapping the fused image to real-world coordinates, which is essential for precise reagent dispensing.

[0230] Smart Reagent Dispensing

[0231] The automatic staining device (1) of the invention preferably optimizes reagent dispensing by calculating the optimal positions and volumes for reagent droplets over the detected tissue regions. In some embodiments, the system calculates maximal dispensing zones based on the size and distribution of tissue regions. Maximal dispensing zones are determined by analysing the spatial distribution of tissue regions and calculating positions that maximize coverage with minimal reagent usage. Geometric algorithms may be utilized to define these zones, considering factors such as the size, shape, and proximity of tissue areas.

[0232] Strategies may be implemented to merge adjacent dispensing zones when possible, reducing the number of dispensing actions required. If neighbouring droplets can be merged without exceeding maximum allowed volumes, the system fuses these droplets into a single larger drop. The device preferably evaluates whether merging zones results in efficient coverage without exceeding maximum allowable reagent volumes per dispensing action.

[0233] Drop locations may be adjusted to centre over tissue regions, and the volume of each drop may be optimized to ensure adequate coverage without excess reagent usage. Volume minimization techniques adjust the volume of reagent dispensed based on the area of tissue to be covered, optimizing reagent usage and minimizing waste.

[0234] For example, the system may first calculate individual droplets to cover the tissue region and then merge adjacent droplets if fusion results in a reduced total volume. The resulting droplets can then be centred over the largest tissue areas, ensuring full coverage while optimizing reagent usage. This intelligent dispensing mechanism may achieve significant reductions in reagent usage, possibly around 46%, by optimizing dispensing zones and minimizing wastage. The device may thus adjust dispensing parameters dynamically based on factors such as tissue size, shape, and location.

[0235] CLAUSES

[0236] 1. A computer-implemented method for performing treatments of histological staining, immunoenzymatic staining and hybridisation on tissue sections or cell smears, comprising the steps of: i. disposing one or more previously prepared samples on at least one sample holder, optionally labelled with identification codes, in a staining or hybridisation area, segmented into a plurality of compartments that act as reaction chambers for a plurality of staining or hybridisation treatments on said samples disposed therein; ii. capturing at least one image by means of a high-precision photographic image capture device, of the position of each sample holder in the respective reaction chamber and, optionally, the identification code disposed on the sample holder; iii. capturing at least one high-precision image of one or more samples disposed on said sample holder by a high-precision photographic image capture device; iv. capturing at least one high-precision image of one or more reagent vials; v. performing said treatments on the samples disposed in the compartments acting as reaction chambers, by means of the provision of a robotic device, configured for its three- dimensional displacement along the three axes XYZ, and adapted to be positioned at any point of said staining or hybridisation area of the compartments located in the horizontal plane XY, and which carries out, by means of a general purpose microcontroller with a computer program, the control of the processes that comprise:

[0237] - processing at least one image of the sample holder by Artificial Intelligence (Al) and, optionally, of the label with codes disposed thereon, wherein the processing of the at least one image of the sample holder comprises determining the position of each sample holder;

[0238] - dispensing specific reagents or common reagents based on a pre-programmed protocol of processes to be applied, depending on:

[0239] 1 . - the reading of identification codes disposed on specific reagent reservoirs;

[0240] 2. - the quantity, location and time of dispensing;

[0241] 3. - image capture of at least one sample, processed by Artificial Intelligence (Al), wherein the processing comprises tissue detection directly performed by a CNN neural network model;

[0242] 4. - image capture of at least one reagent vial, processed by Al, wherein the processing of said image of the reagent vials includes the detection of whether the vial is open or closed;

[0243] - performing washes after each process protocol and / or each process independently; and

[0244] - obtaining data from the images captured of each sample and, optionally, related to each identification code of the sample holders. The method according to claim 1 , wherein the labels of the sample holders have codes that allow identifying the sample, the case to which it corresponds, the protocol to be operated therein and the order of priority to be applied to each sample and / or each protocol. The method according to claim 1 , characterised in that the microcontroller carries out the control of the following functions: a) start the method; b) check that the lid is closed and activate a lock to prevent it from opening during operation; c) check the correct placement of all the elements, particularly the sample holders in the reaction chambers; d) check that all equipments involved in the method during the execution of the process protocols are ready, including, at least, among said checks, the washing and purging process protocols of all reagent, air and any other solution dispensing probes used during the rest of said process protocols; e) optionally, read, by means of at least one high-precision image capture camera, all the labels of each sample holder, to identify the sample to be treated, the case from which it comes, the process protocol(s) to be executed, in the treatment of said sample; the order of priority of said process protocols; as well as carry out the detection of the tissue or cell smear existing on each sample holder and also carry out the delimitation of the position and amount of tissue or cells in each area of each sample holder; f) if all the initial checks have been passed, begin to execute one or more process protocols, by dispensing reagents in the samples for which an image capture of the identification codes of the respective specific reagent reservoirs and mixing tubes is carried out by Al if there is mixture in the series; g) calculate the time stamps and prioritise the process protocols to be executed, based on the previous readings and, based on the specific process protocol, determining the reagents and the amount of said reagents to be dispensed in each area of the sample holder; h) periodically update the timestamps and prioritisation of the process protocols of step g), until all processes of all protocols have been completed; and i) finish, when all the final maintenance tasks are concluded, then activating a low energy consumption routine.

[0245] 4. The method according to any of the preceding claims, wherein prior to its start, a list of tissue samples or cell smears to be processed, each of which identified with a sample code and the process protocol to be developed in those tissues or cell smears, as well as the corresponding code of the temporal priority of each sample and the personal data of the subject from whom it has been extracted, has been loaded into the database of the computer program comprised in the microprocessor. 5. The method, according to any of the preceding claims, wherein prior to its start, a list of protocols has been loaded into the database of the computer program comprised in the microprocessor, each of which details the reagents and processes to be followed to perform a certain treatment on a type of tissue sample or cell smear.

[0246] 6.

[0247] 6. The method according to anyone of the preceding claims, wherein, during the performance of a treatment, the process protocols may be in any of the following states:

[0248] 7. - READY: when a protocol is ready to begin its execution;

[0249] 8. - EXEC: when a protocol is in the execution state; and

[0250] 9. - EXEC_OK: when a protocol has completed its execution.

[0251] 10.

[0252] 7. The method according to any of the preceding claims, wherein, depending on the specific action they are carrying out, the processes of each protocol may in turn be in one of the following states:

[0253] 11. - Not ready: when a process is not ready for execution;

[0254] 12. - READY: when a process is ready for execution;

[0255] 13. - EXEC: when a process is in an execution state;

[0256] 14. - EXEC_OK: when a process has finished its execution, but is waiting for the next process to start; and

[0257] 15. - FINISHED: when a process has completed its execution and the next process has started its own.

[0258] 16.

[0259] 8. The method according to any of the preceding claims, wherein the robotic device (8) also comprises at least one reagent spreader roller (33).

[0260] 9. The method according to any of the preceding claims, comprising carrying out maintenance processes, based on changes in environmental conditions of temperature and humidity.

[0261] 17.

[0262] 10. The method according to any of the preceding claims, wherein the dispensing of reagents by a robotic device (8) is replaced by a manual dispensing.

[0263] 18.

[0264] 11 . The method according to any one of the preceding claims, wherein the probes and reagent spreader roller (33) are washed each time they are used during the performance of any process. The method according to any of the preceding claim, wherein the method further comprises a step of monitoring the temperature in the plurality of compartments acting as reaction chambers by means of an infrared (IR) sensor. The method according to any of the preceding claims, wherein the method further comprises a dynamic planning step comprising steps for adaptively programming tasks of the robotic device (robotic tasks) in a time interval, wherein the robotic device is coupled to a staining or hybridisation apparatus, wherein the robotic device treats slides coupled to the staining or hybridisation apparatus according to a treatment protocol with reagents in reagent or fluid reservoirs coupled to the staining or hybridisation apparatus, wherein the steps comprise:

[0265] - creating a task list of the robotic device comprising all robotic tasks that are ready for execution within the time interval;

[0266] - calculating a robotic task priority for each robotic task on the robotic task list;

[0267] - sorting the list of robotic tasks in descending order of priority of robotic tasks;

[0268] - adding robotic tasks by continuously prioritising;

[0269] - changing the order of the processes of the robotic device as it acts, and

[0270] - reporting the state of each of the processes of the robotic device. A system for performing treatments of histological staining, immunoenzymatic staining and hybridisation on tissue sections or cell smears comprising:

[0271] - a general-purpose microcontroller;

[0272] - means for storing data in one or more databases;

[0273] - a USB bus;

[0274] - a CAN bus;

[0275] - a main electronic card, connected to the USB bus configured to allow communication with the microcontroller, and on the other hand to the CAN bus configured to propagate and receive the information from the other cards, and control:

[0276] • motors of a robotic device (8), together with its encoders and end-of-stroke sensors, for the X and Y axes;

[0277] • reagent presence and level detection sensors; • open / close detection sensors;

[0278] • indicator light to indicate the system state;

[0279] • cold table for reagent maintenance;

[0280] • interface (34) to control at least one precision probe (32);

[0281] - an electronic motion control board, connected to the can bus, configured to control the motors of the robotic device (8) based on the different axes XYZ (30) configured to control:

[0282] • motors of the robotic device (8), together with its encoders and end-of-stroke sensors;

[0283] • interface for at least one liquid level detection (LLD) sensor;

[0284] - a hydraulic control board that is connected to the CAN bus, configured to control hydraulic circuits of the instrument:

[0285] • peristaltic pumps with stepper motors;

[0286] • direct current pumps;

[0287] • direct current valves;

[0288] • air compressors;

[0289] • blowing system air flow rate sensor (36);

[0290] - a compartment control card connected to the CAN bus, configured to control the thermal actuators of reaction chambers disposed in said compartments, and which also controls:

[0291] • actuators for the control of resistive heaters;

[0292] • interfaces of the resistive temperature sensors;

[0293] • actuators to control light indicators (12) indicative of the state of each reaction chamber; and further comprising: i. a staining or hybridisation area (2), segmented into various compartments (9) adapted for the function of reaction chambers of the different treatments to be executed in them, in each of which one or more previously prepared samples are disposed on sample holders (14), optionally labelled with identification codes; ii. a robotic device (8), which has means to move freely along the three axes XYZ (30), adapted to be positioned at any point in the area (2) of the compartments (9), wherein the area (2) is located in the horizontal plane XY, and comprising the following elements:

[0294] - at least one high-precision image capture camera (31) adapted to capture images of the position of the sample holders and / or of the physical characteristics of the samples and, optionally, of the identification codes, disposed on the sample holders (14), as well as of the identification codes disposed on specific reagent reservoirs (22);

[0295] - at least one probe adapted for the dispensing of specific reagents and at least one probe adapted for the dispensing of common reagents;

[0296] - at least one probe adapted for washing; and

[0297] - at least one general-purpose microcontroller with a computer program for the control of all the protocols, processes, members and equipment that form or operate the system.

[0298] 15. The system according to claim 14, wherein the probes comprise:

[0299] - at least one comb (35) with at least one common reagent dispensing probe (35a);

[0300] - at least two washing probes of a diameter greater than the dispensing probes, adapted for performing washes and connected directly to the common reagent reservoirs (5a); and

[0301] - at least one reagent spreader roller (33), adapted for spreading reagents dispensed onto the sample holders (14).

[0302] 16. The system according to claim 14 or 15, wherein each of said compartments (9) comprises a lower face that rests on a thermal blanket (15), on a vibration system (16) and on a waste tray (3) and by its upper face, bevelled, grooved or milled, the lower face of the sample holder (14) of size and shape adapted to that bevelling, grooving or milling is supported, keeping the perimeter of the upper face of the sample holder (14) in flight and isolated, preventing the reagent that is dispensed on it from spilling out of the area by surface tension; and wherein, between each bevel, groove or milling, grooves (13) are placed transversely for the expulsion of excess waste towards a waste tray (3).

[0303] 21.

[0304] 17. The system according to any one of claims 14 to 16, further comprising a dual drainage device which, through two pumps, connects the waste tray (3) of all the compartments with at least two waste tanks, one for hazardous waste and one for non-hazardous waste.

[0305] 22.

[0306] 18. The system according to any one of claims 14 to 17, wherein the dispensing probes are connected with at least one area (5) of common reagent reservoirs and at least one area of specific reagents (6).

[0307] 23.

[0308] 19. The system according to any one of claims 14 to 18, further comprising at least one air blow drying system (36).

[0309] 24.

[0310] 20. The system according to any one of claims 14 to 19, further comprising automatic washing devices (25) using washing solutions.

[0311] 25.

[0312] 21. The system according to any one of claims 15 to 20, wherein the common reagent dispensing comb (35) is formed by at least six dispensing probes (35a) and at least six common reagent tubes.

[0313] 26.

[0314] 22. The system according to any one of claims 14 to 21 , further comprising at least one washing station (25) of the probes of the system.

[0315] 27.

[0316] 23. The system according to any one of claims 14 to 22, comprising at least one washing (25) and drying station for the spreader roller (33) and the comb (35) of probes (35a).

[0317] 28.

[0318] 24. The system according to any one of claims 14 to 23, comprising at least one automatic reagent mixing area (27).

[0319] 29.

[0320] 25. The system according to any one of claims 14 to 24, comprising at least one gas removal filter (41).

[0321] 30.

[0322] 26. The system according to any one of claims 16 to 25, wherein the thermal blanket (15) is provided with a thermal probe for the control and maintenance of the temperatures of the different protocols carried out by the system.

[0323] 31.

[0324] 27. The system according to any one of claims 14 to 26, wherein each compartment has a light indicator (12) to identify the fault state or the state of the protocol in execution in said compartment.

[0325] 32.

[0326] 28. The system according to any one of claims 17 to 27, wherein the waste tray (3) has a level sensor.

[0327] 33.

[0328] 29. The system according to any one of claims 19 to 28, wherein the air blow drying system (36) integrates a compressor and a flow sensor.

[0329] 34.

[0330] 30. The system according to any one of claims 14 to 29, further comprising an automatic washing device (25) of the compartments (9), consisting of a tube connected to a pump disposed in a container containing a specific washing solution determined by the control device, based on the specific process protocol being developed in said compartment.

[0331] 35.

[0332] 31 . The system according to any one of claims 18 to 30, wherein the specific reagent reservoir area comprises a thermostatted rack (23), the temperature of which is controlled by the programmable device that controls the system.

[0333] 36.

[0334] 32. The system according to any one of claims 18 to 31 , wherein the common reagent reservoir area (5) has a weight volume sensor for each reservoir (5a).

[0335] 37.

[0336] 33. The system according to any one of claims 18 to 32, wherein the specific reagent reservoir area has a capacitance volume sensor in the probe to detect the reagent level in each reservoir.

[0337] 38.

[0338] 34. The system according to any one of claims 14 to 33, wherein the system (1) comprises at least one infrared sensor (42) for monitoring the temperature in the plurality of compartments (9) adapted for the function of reaction chambers.

[0339] 39.

[0340] 35. The system according to any one of claims 14 to 34, wherein the system is configured to execute a dynamic planning method comprising steps for adaptively programming tasks of the robotic device (robotic tasks) in a time interval, wherein the robotic device is coupled to the staining or hybridisation system, wherein the robotic device treats slides coupled to the staining or hybridisation system according to a treatment protocol with reagents in reagent or fluid reservoirs coupled to the staining or hybridisation system, wherein the steps comprise: - creating a task list of the robotic device comprising all robotic tasks that are ready for execution within the time interval;

[0341] - calculating a robotic task priority for each robotic task on the robotic task list;

[0342] - sorting the list of robotic tasks in descending order of priority of robotic tasks;

[0343] - adding robotic tasks by continuously prioritising;

[0344] - changing the order of the processes of the robotic device as it acts, and

[0345] - reporting the state of each of the processes of the robotic device.

[0346] 36. The system of any one of claims 14 to 35, adapted to perform the method of any one of claims 1 to 13.

[0347] 40.

[0348] 37. The system according to claim 14 wherein the system can be operated manually, without the intervention of a robotic device (8) adapted for capturing high-precision images and dispensing reagents.

[0349] 41.

[0350] 38. An apparatus (1) for the performance of histological staining, immunoenzymatic staining and hybridisation treatments on tissue sections or cell smears comprising: i. a staining or hybridisation area (2), covered by a lid (100), segmented into various compartments (9) adapted for the function of reaction chambers of the different treatments to be executed therein, in each of which one or more previously prepared samples are disposed on at least one sample holder (14), optionally labelled with identification codes; ii. a robotic device (8), which has means to move freely along the three axes XYZ (30), adapted to be positioned at any point in the area (2) of the compartments (9), wherein the area (2) is located in the horizontal plane XY, a robotic device comprising the following elements:

[0351] - at least one high-precision image capture camera (31) adapted to capture images of the sample holders (14) and / or of the physical characteristics of the samples and, optionally, of the identification codes, disposed on the sample holders (14), as well as of the identification codes disposed on specific reagent reservoirs (22);

[0352] - at least one probe adapted for the dispensing of specific reagents and at least one probe adapted for the dispensing of common reagents;

[0353] - at least one probe adapted for washing; and

[0354] - at least one general purpose microcontroller with a computer program configured for the control of all the protocols, processes, members and equipment that form or operate the apparatus.

[0355] 39. The apparatus according to claim 38, wherein the probes comprise:

[0356] - at least one comb (35) comprising several common reagent dispensing probes (35a);

[0357] - at least two washing probes of a diameter greater than the dispensing probes, adapted for washing and connected directly to common reagent reservoirs (5a); and

[0358] - at least one reagent spreader roller (33), adapted for spreading reagents dispensed onto the sample holders (14).

[0359] 40. The apparatus according to claim 38 or 39, wherein each of said compartments (9) comprises a lower face that rests on a thermal blanket (15), on a vibration system (16) and on a waste tray (3) and by its upper face, bevelled, grooved or milled, the lower face of the glass sample holder (14) of size and shape adapted to that bevelling, grooving or milling is supported, keeping the perimeter of the upper face of the glass sample holder (14) in flight and isolated, preventing the reagent that is dispensed on it from spilling out of the area by surface tension; and wherein, between each bevel, groove or milling, grooves (13) are placed transversely for the expulsion of surplus waste towards a waste tray.

[0360] 41. The apparatus according to any one of claims 38 to 40, further comprising a double dual device which, through two pumps, connects the waste tray (3) of all the compartments with at least two waste tanks, one for hazardous waste and one for non-hazardous waste.

[0361] 42.

[0362] 42. The apparatus according to any one of claims 38 to 41 , wherein the dispensing probes are connected to at least one common reagent reservoir area (5) and at least one specific reagent area (6).

[0363] 43.

[0364] 43. The apparatus according to any one of claims 38 to 42, further comprising at least one air blow drying system (36).

[0365] 44.

[0366] 44. The apparatus according to any one of claims 38 to 43, further comprising automatic washing devices (25) using washing solutions.

[0367] 45.

[0368] 45. The apparatus according to any one of claims 39 to 44, wherein the common or general reagent dispensing comb (35) is formed by at least six dispensing probes (35a) and at least six common or general reagent tubes.

[0369] 46.

[0370] 46. The apparatus according to any one of claims 38 to 45, further comprising at least one washing station (25) of the probes of the apparatus.

[0371] 47.

[0372] 47. The apparatus according to any one of claims 38 to 46, comprising at least one washing (25) and drying station of the spreader roller (33) and the comb (35) of probes (35a).

[0373] 48.

[0374] 48. The apparatus according to any one of claims 38 to 47, comprising at least one automatic reagent mixing area (27).

[0375] 49.

[0376] 49. The apparatus according to any one of claims 38 to 48, comprising at least one gas removal filter (41).

[0377] 50.

[0378] 50. The apparatus according to any one of claims 40 to 49, wherein the thermal blanket (15) is provided with a thermal probe for the control and maintenance of the temperatures of the different protocols performed by the apparatus (1).

[0379] 51.

[0380] 51 . The apparatus according to any one of claims 38 to 50, wherein each compartment (9) has a light indicator (12) to identify the fault state or the state of the protocol executed in said compartment (9).

[0381] 52.

[0382] 52. The apparatus according to any one of claims 41 to 51 , wherein the waste tank (3) is provided with a level sensor.

[0383] 53.

[0384] 53. The apparatus according to any one of claims 43 to 52, wherein the air blowing device (36) integrates a compressor and a flow sensor.

[0385] 54.

[0386] 54. The apparatus according to any one of claims 38 to 53, further comprising an automatic washing device (25) for the compartments (9), consisting of a tube connected to a membrane pump disposed in a container containing a specific washing solution determined by the control device, based on the specific protocol being developed in said compartment (9).

[0387] 55.

[0388] 55. The apparatus according to any one of claims 42 to 54, wherein the specific reagent reservoir area (6) comprises a thermostatted rack (23), the temperature of which is controlled by the programmable device, which controls the entire system.

[0389] 56.

[0390] 56. The apparatus according to any one of claims 42 to 55, wherein the common reagent reservoir area (5) has a weight volume sensor for each reservoir (5a).

[0391] 57.

[0392] 57. The apparatus according to any one of claims 42 to 56, wherein the specific reagent reservoir area (6) has a capacitance volume sensor in the probe to detect the regent level in each reservoir.

[0393] 58.

[0394] 58. The apparatus according to any one of claims 38 to 57, wherein the apparatus comprises at least one infrared sensor (42) for monitoring the temperature in the plurality of compartments (9) adapted for the function of reaction chambers.

[0395] 59.

[0396] 59. The apparatus according to any one of claims 38 to 58, wherein the apparatus is configured to execute a dynamic planning method comprising steps for adaptively programming tasks of the robotic device (robotic tasks) in a time interval, wherein the robotic device is coupled to the staining or hybridisation apparatus, wherein the robotic device treats slides coupled to the staining or hybridisation apparatus according to a reagent treatment protocol in reagent or fluid reservoirs coupled to the staining or hybridisation apparatus, wherein the steps comprise:

[0397] - creating a task list of the robotic device comprising all robotic tasks that are ready for execution within the time interval;

[0398] - calculating a robotic task priority for each robotic task on the robotic task list;

[0399] - sorting the list of robotic tasks in descending order of priority of robotic tasks; adding robotic tasks by continuously prioritising;

[0400] - changing the order of the processes of the robotic device as it acts; and,

[0401] - reporting the state of each of the processes of the robotic device.

[0402] 60. The apparatus for carrying out treatments of histological staining, immunoenzymatic staining and hybridisation on tissue sections or cell smears adapted to perform the method of any of claims 1 to 13, or to execute the system of claims 14 to 37.

[0403] 60.

[0404] 61 . The apparatus according to claim 38, wherein the robotic device (8) adapted for the capture of high-precision images and dispensing of reagents on the samples, is replaced by a manual dispensing of reagents. A computer program product for performing treatments of histological staining, immunoenzymatic staining, and hybridisation on tissue sections or cell smears comprising instructions that, when executed in the system of claims 14 to 37, cause the computer means to perform the method of claims 1 to 13. The computer program product according to claim 62, comprising a computer-readable medium, which, in turn, comprises encoded instructions for controlling a microprocessor that processes images from a sample disposed on a sample holder, comprising: a) means for self-calibrating at least one high-precision image capture camera (31) capable of capturing images of the placement of at least one sample holder (14), of the samples to be stained or hybridised and, optionally, of the identification codes, disposed on the sample holders (14), as well as of the identification codes disposed on specific reagent reservoirs (22); b) means for capturing images of the sample holder (14) that carries the samples, specifically of the placement of the sample holder (14) and, optionally, of the identification codes disposed on the sample holders (14); c) means for capturing images of the samples to be stained or hybridised; d) means for capturing images of the reagent reservoirs (5a, 22) to be applied in the treatments of the samples; e) means for processing the images captured from the sample holders; f) means for processing the images captured from the specific reagent reservoirs; g) means for sending movement orders to a robotic device (8) carrying at least one high- precision image capture camera (31) and fluid dispensing means, which moves from compartment (9) to compartment (9), wherein at least one sample holder (14) with samples is located; and h) Artificial Intelligence (Al) processing means of the high-precision images of the captured samples, for sending orders for improving the quantity, location and dispensing times of the reagents to be dispensed in said samples. The computer program product according to claim 63, wherein the means for processing images captured from the samples disposed on the sample holders comprises: i. means for calculating the areas of the polygons that make up the segmented images of the captured samples; ii. means for calculating the dispensing positions of the reagents that allow covering the entire sample with the minimum amount of reagent; and iii. means of generating an output file that, at least, contains: reading the identification codes of the sample holder, reading the areas of the polygons of the image of the captured segmented sample, positions and volumes of the reagents to be dispensed.

[0405] 65. The computer program product according to claim 63 or 64, wherein the means for sending dispensing orders, by the robotic device (8), of the reagents, comprises: i. means for reading the output file generated in the processing of the captured sample holder images; and ii. means for sending orders to the robotic device (8) to be positioned in the chamber where the sample holder (14) is disposed with the sample corresponding to the output file and dispense the volume of reagent and in the positions determined in said output file.

[0406] 66. The computer program product according to any one of claims 63 to 65, comprising means for applying process protocols existing in the computer program and previously selected about the treatments of histological staining, immunoenzymatic staining and hybridisation on tissue sections or cell smears comprised in said sample, based on the image capture performed on said sample and the area of said sample, the contours thereof, its position and the amount of sample to be treated.

[0407] 63.

[0408] 67. The computer program product according to any one of claims 63 to 66, comprising maintenance means of the system and / or of the apparatus to be applied according to environmental parameters, such as temperature or humidity.

[0409] 64.

[0410] 68. The computer program product according to any one of claims 63 to 67, comprising means for sending orders to finish each protocol and / or process and / or to pause the system.

[0411] 65.

[0412] 69. The computer program product according to any one of claims 63 to 68, comprising means for relating the readings of the identification codes of the samples to the image captures of said samples.

[0413] 66.

[0414] 70. The computer program product according to any of claims 63 to 69, comprising means for sending orders for dispensing cleaning or washing fluids to be executed in the period between the conclusion of one protocol and / or process and the beginning of a new protocol and / or process.

[0415] 67.

[0416] 71. The computer program product as claimed in any of claims 63 to 70, comprising means that allow the dispensing of reagents by executing commands to a spreader roller (33) of said reagents on the sample when they have a viscous nature.

[0417] 68.

[0418] 72. The computer program product according to claims 63 to 71 , comprising means for pausing the system when the threshold of a predetermined excess timeout is exceeded.

[0419] 69.

[0420] 73. The computer program product according to any one of claims 63 to 72, comprising means for monitoring the infrared (IR) temperature in the plurality of compartments (9) adapted for the function of reaction chambers.

[0421] 70.

[0422] 74. The computer program product according to any one of claims 63 to 73, comprising means for executing a dynamic planning method (planner), and for adaptively programming tasks of the robotic device (robotic tasks) in a time interval, wherein the robotic device is coupled to a staining or hybridisation apparatus, wherein the robotic device treats the slides coupled to the staining or hybridisation apparatus according to a treatment protocol with reagent, reagent or fluid reservoirs coupled to the staining or hybridisation apparatus, wherein the means comprises:

[0423] 71 . - means for creating a to-do list of the robotic device comprising all robotic tasks that are ready for execution within the time interval;

[0424] 72. - means for calculating a robotic task priority for each robotic task on the robotic task list;

[0425] 73. - means for sorting the list of robotic tasks in descending order of priority of robotic tasks; and

[0426] 74. - means for adding robotic tasks continuously prioritising;

[0427] 75. - means for changing the order of the processes of the robotic device as it acts; and

[0428] 76. - means for reporting the states of each of the processes of the robotic device.

[0429] Additional embodiments

[0430] The present invention relates to an apparatus for carrying out treatments of histological staining, immunoenzymatic staining, and hybridisation on tissue sections or cell smears comprising a staining or hybridisation area, covered by a lid, and segmented into various compartments adapted to the function of reaction chambers of the different staining or hybridisation treatments, in each of which one or more previously prepared samples are housed in a sample holder, optionally labelled with codes or texts for identification, and a robotic device, configured for movement along the three axes XYZ, adapted to be positioned at any point in the area of the compartments in the horizontal plane XY.

[0431] Each of said compartments comprises a lower face that rests on or comprises a heating device. In a preferred embodiment of the invention, said heating device is a thermal blanket disposed on a vibration system and on a waste tray; on its upper face, bevelled, slotted, or milled, the lower face of the sample holders, optionally made of glass, of size and shape adapted to that bevelling, slotting, or milling, is supported, maintaining the perimeter of the upper face of the glass slide in flight and isolated, preventing the reagent that is dispensed, automatically or manually on it, from spilling out of the area by surface tension; and wherein, between each bevel, slot, or milling, grooves are transversely located for the expulsion of surplus waste towards a waste tray. Each compartment has a light indicator, preferably a LED, to identify the fault state or the state of the protocol in execution in said passenger compartment. For the purposes of this patent, the terms sample holders, microscope slide, or simply slides, should be considered synonymous.

[0432] In a preferred embodiment of the invention, each compartment as a reaction chamber has a vibration system or vibrator. Thus, in a particular embodiment of the invention, the apparatus can comprise a plurality of vibrators that are controlled independently and depending on whether or not the protocol applied in the chamber activates the commands that allow vibration. Each vibrator is controlled by a specific electronic board. The functions of the vibrators are to move the particles, accelerating the chemical reactions, therefore reducing the incubation time of the reagents and giving greater robustness to the process, and providing dispersion capacity of the reagents on the slide.

[0433] The vibration system is adapted for interaction with the respective reaction chamber and with no other element, allowing an individualised protocol for different samples.

[0434] The robotic device is adapted to integrally incorporate the following elements: one or more high-precision image capture cameras capable of capturing images of the physical characteristics of the samples (contour, shape, texture, colour, etc.) and, optionally, of the identification or indexing codes, disposed on the sample holders, as well as the identification or indexing codes of the reagent reservoirs, which in turn have a level sensor. According to the present invention, the arrangement of the high-precision image capture camera allows an advantageous image acquisition compared to the systems of the state of the art, which in turn allows an improvement of the whole process, in terms of reduction of times, consumption of reagents and energy, and in the quality of the staining or hybridisation achieved. Unlike the chambers of the state of the art, the chamber of the invention is not disposed perpendicularly in relation to the sample holders. This arrangement, angled with respect to the sample holders, allows the acquisition of images with greater three-dimensional detail of the position of the samples to be analysed, as well as avoiding noise caused by lighting on the sample holder, providing greater precision when extracting the physical characteristics of the samples, such as their shape and texture, which in turn allows the apparatus of the invention, trained with artificial intelligence, to determine the staining or hybridisation state and make decisions in relation to whether to continue or stop the staining or hybridisation process. In a particular embodiment, the angle of disposal of the chamber in relation to the sample holder is between 5° and 75°, preferably between 15° and 60°, more preferably between 25° and 45°. It is understood that this acquisition of images requires a series of digital transformation treatments using means provided for this purpose. In order to detect the optical characteristics of the sample to be analysed, it is necessary to place the camera in lighting conditions adapted to the degree of inclination of the chamber.

[0435] In a preferred embodiment of the invention, the apparatus incorporates an Inertial Measurement Unit (IMU). This component is incorporated into the apparatus with two objectives: to have real-time control of the inclination of the reaction chambers, and to detect the stability level of the apparatus installation. The apparatus weighs 150 kg and with the movements of the robot (accelerations and decelerations), high inertial forces can occur that affect the conservation of the reagents on the slide, as well as compromising the integrity of the support on which it is installed. With a robot movement test, the stability level of the installation is detected, and it can be validated.

[0436] To perform the stable calibration of the apparatus, it is important to carry out an accelerometer calibration process, consisting of the following steps: when installing the instrument, the technical service will level it manually, and in the service application it will indicate that the equipment is balanced. The main controller will take a series of measurements, discarding the extremes and storing the average of the remaining ones as "0° inclination" in the x and y axes. From that point on, the unevenness that occurs with respect to that initial equilibrium position can be controlled. In the user application, before carrying out maintenance of the apparatus, it will check the difference with respect to the equilibrium position and inform the user if the maximum permitted inclination is exceeded to ensure improved staining and, if necessary, instruct them to contact the technical service. During the series, it is possible to check the maximum values of the inertial forces due to the movements to inform about the suitability or otherwise of the apparatus installation in the final report of the series. Monitoring of the apparatus state is performed by analysing the vibrations of the device using advanced standards detection techniques such as embedded neural networks, decision trees, vector support machines, among others, to determine the operating state of the apparatus. The detection of present or predictable failures throughout a series allows guaranteeing the quality of the analysis process, preventing errors with the costs associated with the loss of samples or erroneous results.

[0437] For the purposes of the present invention, detection with high-resolution cameras is synonymous with detection with high-precision cameras. It is also understood as multiresolution detection and will range from 640x480 pixels, up to 1920x1200 pixels or more. In a preferred embodiment of the invention, recognition of the identification codes of the reagent reservoirs or of the sample holders is performed by means of a pattern reading algorithm that follows the standard of the printed code (Datamatrix, for example). If the code provided is unreadable or the code is printed or written as characters on the label, the reading is done using an OCR (Optical Character Recognition) algorithm. In another particular embodiment, the indexed information of each sample holder can be manually entered so that the apparatus can identify the characteristics of the sample holder. In another particular embodiment, for reading characters printed by OCR, all possible words and groups of alphanumeric characters on the label are searched / scanned without Al on the label. For each of these scanned regions, the characters are read / interpreted by a recurrent neural network (RNN). In an alternative embodiment, for the detection of codes, convolutional neural networks (CNN) are used and, on the other hand, words and / or groups of alphanumeric characters are searched.

[0438] The apparatus comprises a common or general reagent dispensing comb. In a particular embodiment, the comb is formed by at least six dispensing probes or pipettes and at least six common or general reagent tubes. The dispensing pipettes are connected to at least one area housing a plurality of common reagent reservoirs and at least one area housing a plurality of specific reagents.

[0439] The apparatus further comprises a spreader roller of viscous reagents, thus allowing an even distribution of the reagent throughout the entire sample, or the entire sample holder that, otherwise and due to the high density of some reagents, would have an uneven distribution. The density parameters of each reagent are pre-loaded in the computer program that operates the system. With these density parameters, the program dispenses the reagent at a certain rate directly proportional to said density. Once the reagent has been dispensed, the treatment protocol itself determines whether a spreading of the reagent by the roller is necessary, due to its high viscosity. To do this, the robotic device has up to three Z axes. On the Z2 axis, the roller to be operated is located in a first pass in a certain direction, after the drops of dispensed reagent, spreading the viscous reagent, and lifting the roller before reaching the end of the holder to re-execute the spreading, in a second pass, but now in the opposite direction to the previous one. The viscous reagent spreader roller, therefore, makes a double pass to evenly spread the viscous reagent.

[0440] In a preferred embodiment of the invention, the apparatus comprises at least one mixing and drying unit that houses tubes for the automatic mixing of reagents, an automatic mixing area of reagents, a drying station, among others, of the spreader roller, and washing stations of the spreader roller and of the probes. The mixing and washing unit, disposed adjacent to the area of specific reagents, is advantageous because it allows a rapid and effective cleaning and drying of the spreader roller which, in turn, allows an improvement of the staining or hybridisation.

[0441] In a particular embodiment, the apparatus has an automatic washing device of the specific reagent probe, consisting of a tube connected to a membrane pump disposed in a container containing a specific washing solution determined by the control device, based on the specific reagent previously used by the probe.

[0442] In a preferred embodiment, the apparatus of the invention is further provided with specific reagent dispensing probes and common reagent probes.

[0443] In another particular embodiment, the apparatus of the invention also has washing probes of a diameter greater than the previous dispensing probes for the performance of washes, preferably two probes, and directly connected to the common reagent reservoirs.

[0444] In another particular embodiment, the apparatus of the invention has at least one staining or hybridisation unit disposed in the staining or hybridisation area comprising a plurality of compartments. In a more preferred embodiment, the staining or hybridisation unit is provided with means for housing at least one compartment, preferably three compartments. The staining or hybridisation unit is advantageous since it allows its placement and removal from the area independently of other staining or hybridisation units in use, so that the introduction of new samples in an already initiated process is facilitated and notably does not interfere with the staining or hybridisation process of the rest of the samples.

[0445] In another particular embodiment, the specific reagent reservoir area comprises a thermostatted rack, the temperature of which is controlled by the programmable device, which controls the entire system. The common reagent reservoir area has a weight volume sensor for each reservoir. The specific reagent reservoir area has a capacitance volume sensor in the probe to detect the level of reagent in each reservoir. In the apparatus-method-system, according to the present invention, a double control of the level of reagents in vials is carried out, by capacitance and by internal accounting, with the following objectives: ensuring the dispensing of reagents, considering that the vials can suffer accidents outside the instrument (spills, evaporations) that could reduce the actual volume without the application being aware of this, and inserting the probe as little as possible into the reagents so that the external washing is as fast as possible (time is saved and less reagent is consumed) and possible drips on the apparatus after aspiration are prevented.

[0446] In this way, a file is produced with all the types of vials that exist in the system and for each of them the following information is available: dead volume, geometry of the vial, and depending on the level at which the upper level of liquid is found, the volume it represents.

[0447] Furthermore, the user software has four reagent aspiration modes: LLD-TABLE, LLD, TABLE, and DEEP.

[0448] The common reagent reservoirs have a cap for filling the reagent and have orifices where the connectors for the reagent outlet are fixed to the equipment and allow the reagent outlet for direct dispensing from the robotic arm. The reservoirs have at their base a projection that acts as a support surface of the container whose function is to allow the uniform support of the container on the volume sensor and reduce dead volume of the container. Common reagents do not need identification codes on their reservoirs but use a colour code that uniquely assigns it to the same position on the robotic device.

[0449] In another particular embodiment, the apparatus of the invention has one or more double drainage devices that, through two pumps, connect the waste tray of the compartments with at least two waste tanks, one for hazardous waste and another for non-hazardous waste. In another particular embodiment, the waste tanks are provided with a level sensor.

[0450] In another particular embodiment, the apparatus of the invention has one or more air blow drying systems, which integrate a compressor and a flow sensor. In this way, the present invention has means to carry out a simultaneous blowing and washing of a sample holder, in a single step, removing the existing reagent on it, quickly allowing the execution of the next step of the process.

[0451] The apparatus-system-method of the present invention, according to a preferred embodiment thereof, incorporates an air flow rate sensor before the blower nozzle. The purpose of this sensor is to control that when the compressor is activated, the desired air flow rate is actually generated to remove the reagent on the slide. This sensor does not require calibration and, depending on the flow rate of the blower nozzle, it will act at a greater or lesser distance from the upper face of the slide. The calculation of the flow rate is performed instantly, measured in litres / minute, as well as accumulated, calculating the litres of air that have circulated through the blower nozzle. To calculate the absolute litres, an integral is made with a fixed time step. The calculation of the flow rate allows dynamically adjusting the power applied to the compressor to ensure the desired flow rate. This is done with the aim of cushioning the effects of compressor wear, as well as possible obstructions to the passage of air.

[0452] Thus, the present invention allows an improvement of the staining or hybridisation process carried out by the tasks of the system.

[0453] In another particular embodiment, the apparatus of the invention has a filter for gas removal that is automatically activated when reagents with hazardous vapours are used.

[0454] In another particular embodiment, the apparatus of the invention has one or more thermal blankets provided with a thermal probe for the control and maintenance of the temperatures of the different protocols to be carried out.

[0455] In another particular embodiment, each compartment has a light indicator to identify the fault state or the state of the protocol in execution in said compartment.

[0456] In another particular embodiment, the apparatus further comprises an automatic washing device of the compartments, consisting of a tube connected to a membrane pump disposed in a container containing a specific washing solution determined by the control device, based on the specific protocol being developed in said compartment.

[0457] In another particular embodiment, the specific reagent reservoir area comprises a thermostatted rack, the temperature of which is controlled by the programmable device, which controls the entire system.

[0458] In another particular embodiment, the common reagent reservoir area has a weight volume sensor for each reservoir.

[0459] In another particular embodiment, the specific reagent reservoir area has a capacitance volume sensor in the probe to detect the level of reagent in each reservoir.

[0460] In another particular embodiment, the apparatus comprises at least one infrared sensor for monitoring the temperature in the plurality of compartments adapted for the function of reaction chambers.

[0461] In another particular embodiment, the apparatus comprises means for executing a dynamic planning method (planner) according to the invention. The apparatus of the invention has a general-purpose microcontrollerwith a computer program for the control of all the protocols, reagents, processes, members, and equipment that form or operate the apparatus.

[0462] The present invention also relates to a system for performing treatments of histological staining, immunoenzymatic staining, and hybridisation on tissue sections or cell smears comprising, among others, the following components:

[0463] - A general-purpose microcontroller;

[0464] - Means for storing data in one or more databases;

[0465] - A USB bus;

[0466] - A CAN bus;

[0467] - A main electronic card, connected to the USB bus to allow communication with the microcontroller, and on the other hand to the CAN bus to propagate and receive the information from the other cards and control, among others:

[0468] • The motors of a robotic device, together with its encoders and end-of-stroke sensors, for the X and Y axes;

[0469] • Reagent presence and level detection sensors;

[0470] • Open / close detection sensors;

[0471] • Indicator light, preferably LED, to indicate the system state;

[0472] • Cold table for reagent maintenance;

[0473] • Interface to control a precision probe;

[0474] - Electronic motion control cards, connected to the CAN bus, intended to control the motors of the robotic device based on the different XYZ axes and which controls, among others:

[0475] • The motors of the robotic device, together with their encoders and end-of-stroke sensors;

[0476] • Interface for liquid level detection sensor (LLD - Liquid Level Detection);

[0477] - A hydraulic control board that is connected to the CAN bus and is intended to control the different hydraulic circuits of the instrument, among others:

[0478] • Peristaltic pumps with stepper motors;

[0479] • Direct current pumps;

[0480] • Direct current valves;

[0481] • Air compressors; The blowing system air flow rate sensor;

[0482] - A vibrator control board connects to the CAN bus, intended for the control of the vibrators located in the reaction chambers;

[0483] - A compartment control card connected to the CAN bus, intended to control the thermal actuators of the reaction chambers disposed in said compartments and which controls, among others:

[0484] • The actuators for the control of resistive heaters;

[0485] • The interfaces of the resistive temperature sensors;

[0486] • The actuators to control the LED lights indicative of the state of each reaction chamber.

[0487] The system comprises a staining or hybridisation area, covered by a lid, and segmented into various compartments that act as reaction chambers for the different treatments to be executed therein, in each of which a previously prepared sample is disposed on sample holders, optionally labelled with identification codes. Each of said compartments comprises a lower face that rests on a thermal blanket, on a vibration system and on a waste tray, and on its upper face, bevelled, grooved, or milled, the lower face of a sample holder or sample holders is supported, for example, of glass, of a size and shape adapted to that bevelling, grooving, or milling, keeping the perimeter of the upper face of the glass holder in flight and isolated, preventing the reagent that is dispensed, automatically or manually on it, from spilling out of the area by surface tension. Between each bevel, groove, or milling, grooves are placed transversely for the expulsion of surplus waste towards a waste tray. In a particular embodiment, the thermal blanket is provided with a thermal probe for the control and maintenance of the temperatures of the different protocols to be developed.

[0488] The system has a robotic device, which moves freely along the three axes XYZ and can be positioned anywhere in the area of the compartments located in the horizontal plane XY. It can comprise:

[0489] - At least one high-precision image capture camera configured to capture images of the physical characteristics of samples and, optionally, of the identification codes, disposed on the sample holders, as well as of the identification codes of the specific reagent reservoirs, which have a level sensor;

[0490] - Dispensing probes for specific reagents and / or common reagents;

[0491] - A common or general reagent dispensing comb, which may comprise a plurality of dispensing probes, preferably at least six dispensing probes or pipettes, and at least six common or general reagent tubes. The dispensing pipettes are connected to at least one common reagent reservoir area and at least one specific reagent area;

[0492] - At least two washing probes of a diameter greater than the previous dispensing probes, for washing and connected directly to the common reagent reservoirs; and

[0493] - A reagent spreader roller.

[0494] In a particular embodiment, the system comprises an automatic cabin washing device, consisting of a tube connected to a membrane pump disposed in a container containing a specific washing solution determined by the control device, based on the specific protocol being developed in said cabin.

[0495] In a particular embodiment, the specific reagent reservoir area comprises a thermostatted rack, the temperature of which is controlled by the programmable device, which controls the entire system. The common reagent reservoir area has a weight volume sensor for each reservoir. The specific reagent reservoir area has a capacitance volume sensor in the probe to detect the level of reagent in each reservoir. The common reagent reservoirs have a cap for filling the reagent and have orifices where the connectors for the reagent outlet are fixed to the equipment and allow the outlet of reagent for direct dispensing from the robotic device. The reservoirs have at their base a projection that acts as a support surface of the container whose function is to allow the uniform support of the container on the volume sensor and reduce dead volume of the container. Common reagents do not need identification codes on their reservoirs but use a colour code that uniquely assigns it to the same position on the robotic device. In contrast to determining whether a suitable amount of reagents to be used in the sequence of the treatment protocol is available in the plurality of compartments in the systems of the state of the art, the present invention allows the indication to the user which specific reagents have to be introduced into at least one of the plurality of compartments, wherein the slides have been included.

[0496] In a particular embodiment, the system comprises one or more double drainage devices that, through two pumps, connect the waste tray of all the compartments with at least two waste tanks, one for hazardous waste and another for non-hazardous waste. One or more air blow drying systems, integrating a compressor and a flow sensor. In a particular embodiment, the waste tray may have a level sensor that allows recognising when it is full to warn of possible problems in the emptying system. In addition, the waste tray may have a gravity overflow that prevents hazardous or non-hazardous waste from falling on the rest of the instrument or on the work table. In a particular embodiment, the system comprises an automatic reagent mixing area.

[0497] In a particular embodiment, the system comprises a gas removal filter.

[0498] In a particular embodiment, the system comprises one or more thermal blankets provided with a thermal probe for the control and maintenance of the temperatures of the different protocols to be developed.

[0499] In another particular embodiment, the system comprises at least one infrared sensor for monitoring the temperature in the plurality of compartments adapted for the function of reaction chambers.

[0500] In another particular embodiment, the system comprises means for executing a dynamic planning method (planner) according to the invention.

[0501] The present invention also relates to a computer-implemented method for carrying out treatments of histological staining, immunoenzymatic staining, and hybridisation on tissue sections or cell smears, which has one or more previously prepared samples on a sample holder, optionally labelled with identification codes, in an area, covered by a lid, and divided into various compartments that act as reaction chambers for the different protocols or treatments to be executed on said samples disposed therein.

[0502] The inventive apparatus and system are advantageously configured to execute the inventive method. Thus, the invention relates to a computer-implemented method for performing treatments of histological staining, immunoenzymatic staining, and hybridisation on tissue sections or cell smears, comprising the steps of: i. Disposing one or more previously prepared samples on at least one sample holder, optionally labelled with identification codes, in a staining or hybridisation area, segmented into a plurality of compartments that act as reaction chambers for a plurality of staining or hybridisation treatments on said samples disposed; ii. Capturing at least one image by means of a high-precision photographic image capture device, of the position of each sample holder in the respective reaction chamber and, optionally, the identification code disposed on the sample holder; iii. Capturing at least one high-precision image of one or more samples disposed on said sample holder by a high-precision photographic image capture device; iv. Performing said treatments on the samples disposed in the compartments acting as reaction chambers, by means of the provision of a robotic device, configured for its three-dimensional displacement along the three axes XYZ, and adapted to be positioned at any point of said staining or hybridisation area of the compartments located in the horizontal plane XY, and which carries out, by means of a general-purpose microcontroller with a computer program, the control of the processes that comprise:

[0503] - Processing the at least one image of the sample holder and, optionally, of the label with codes disposed on it;

[0504] - Dispensing specific reagents or common reagents based on a pre-programmed protocol of processes to be applied, depending on:

[0505] - the reading of identification codes disposed on specific reagent reservoirs;

[0506] - the quantity, location, and time of dispensing;

[0507] - image capture of the at least one sample, processed by Artificial Intelligence (Al);

[0508] - Performing washes after each process protocol and / or each process independently; and

[0509] - Obtaining data from the images captured of each sample and, optionally, related to each identification code of the sample holders.

[0510] In a particular embodiment, the labels of the sample holders carry codes that allow identifying the sample, the case to which it corresponds, the protocol to be operated on it, and the order of priority to be applied to each sample and / or to each protocol.

[0511] In a particular embodiment, the method is characterised in that the microcontroller carries out the control of the following functions: a) Start the method; b) Check that the lid is closed and activate a lock to prevent it from opening during operation; c) Check the correct placement of all the elements, particularly the sample holders in the reaction chambers; d) Check that all equipment involved in the method during the execution of the process protocols is ready, including, at least, among said checks, the washing and purging process protocols of all reagents, air, and any other solution dispensing probes used during the rest of said process protocols and if the equipment is correctly balanced; e) Optionally, read, by means of at least one high-precision image capture camera, all the labels of each sample holder, to identify the sample to be treated, the case from which it comes, the process protocol or protocols to be executed, in the treatment of said sample; the order of priority of said process protocols; as well as carry out the detection of the tissue or cell smear existing on each sample holder and also carry out the delimitation of the position and amount of tissue or cells in each area of each sample holder. In a particular embodiment, a K-means model is used to, once the regions that are candidates to be tissues are detected, disregard all those regions that are considered noise insofar as they differ significantly in texture, position, and geometric dimensions (width and height). In another particular embodiment, tissue detection is performed directly by a CNN neural network model; f) If all the initial checks have been passed, begin to execute one or more process protocols, by dispensing reagents in the samples for which an image capture of the identification codes of the respective specific reagent reservoirs and mixing tubes by Al, if there is mixture in the series; g) Calculate the time stamps and prioritise the process protocols that must be executed, based on the previous readings and, based on the specific process protocol, determining a) the reagents and b) the amount of said reagents that must be dispensed in each area of the sample holder; in a particular embodiment, the calculation of the dispensing positions and volumes is carried out without Al. In an alternative embodiment, the process may be performed by evolutionary Al models, for example, Genetic Algorithms (GA) or Particle Swarm Optimisation (PSO), among others; h) Periodically update the timestamps and prioritisation of the process protocols of step g), until all processes of all protocols have been completed; and i) Finish, when all the final maintenance tasks are concluded, then activating a low energy consumption routine.

[0512] In a particular embodiment, prior to the start of the method, a list of tissue samples or cell smears to be processed has been loaded into the database of the computer program comprised in the microprocessor, each of which is identified with a sample code and the process protocol to be developed in those tissues or cell smears, as well as with the corresponding code of the temporal priority of each sample and the personal data of the subject from whom it has been extracted.

[0513] In a particular embodiment, prior to the start of the method, a list of protocols has been loaded into the database of the computer program comprised in the microprocessor, each of which details the reagents and processes to be followed to perform a certain treatment on a type of tissue sample or cell smear. In another particular embodiment, during the development of a treatment, the process protocols can be in any of the following states:

[0514] - READY: when a protocol is ready to begin its execution;

[0515] - EXEC: when a protocol is in the execution state;

[0516] - EXEC_OK: when a protocol has completed its execution.

[0517] In another particular embodiment, depending on the specific action they are taking, the processes of each protocol may be, in turn, in one of the following states:

[0518] - Not ready: when a process is not ready for execution;

[0519] - READY: when a process is ready for execution;

[0520] - EXEC: when a process is in an execution state;

[0521] - EXEC_OK: when a process has finished its execution but is waiting for the next process to start;

[0522] - FINISHED: when a process has completed its execution and the next process has started its own.

[0523] In another particular embodiment, the method is adapted for application with a robotic device also comprising at least one reagent spreader roller.

[0524] In another particular embodiment, the method comprises performing maintenance processes, based on changes in ambient temperature and humidity conditions.

[0525] In another particular embodiment, the dispensing of reagents by a robotic device is replaced by a manual dispensing.

[0526] In another particular embodiment, the method comprises washing the probes and reagent spreader roller, each time they are used during the development of any process.

[0527] In another particular embodiment, the method further comprises a step of monitoring the temperature in the plurality of compartments acting as reaction chambers by means of an infrared (IR) sensor.

[0528] In another particular embodiment, the method comprises steps for executing a dynamic planning method (planner) according to the invention. In another particular embodiment, the product comprises means for executing a dynamic planning method (planner) according to the invention.

[0529] The present invention also relates to a dynamic planning method (planner) comprising steps for adaptively programming tasks of the robotic device (robotic tasks) of the invention in a time interval, wherein the robotic device is coupled to a staining or hybridisation apparatus, wherein the robotic device treats slides coupled to the staining or hybridisation apparatus according to a treatment protocol with reagents in reagent or fluid reservoirs coupled to the staining or hybridisation apparatus, wherein the steps comprise:

[0530] • creating a robotic device task list comprising all robotic tasks that are ready for execution within the time interval;

[0531] • calculating a robotic task priority for each robotic task on the robotic task list;

[0532] • sorting the list of robotic tasks in descending order of priority of robotic tasks;

[0533] • adding robotic tasks by continuously prioritising;

[0534] • changing the order of the processes of the robotic device as it acts, and

[0535] • reporting the state of each of the processes of the robotic device.

[0536] According to the present invention, the planner does not create a complete list of statically prioritised tasks that is carried out without undergoing modifications from the first moment to the end of the series. On the contrary, and advantageously, the invention allows a dynamic planning wherein the order of the processes of the robot is continuously prioritised and changed as it acts and reports the states of each of them. It is important to mention that it is not the same to list all the prioritised tasks of a series and follow it no matter what happens during the series, than to prioritise and order the processes of a series in real time as the robot is performing them. In the case of static planning, it requires fixed time intervals while in the case of dynamic planning, according to the invention, it adapts to real times and new priorities that occur according to the new realities of each moment. In this way, the robotic device of the invention can advantageously react to the changes produced in the reaction chamber, for example, by including a new sample holder to the staining or hybridisation process carried out by the system / apparatus of the invention. According to the present invention, the scheduler may advantageously be integrated into the method, system, apparatus and / or computer program product of the invention.

Claims

CLAIMS1. An automatic staining device (1) for dispensing staining reagents over one or more biological samples, wherein one or more reagents are delivered through a controlled pressure-driven flow, and wherein the automatic staining device (1) comprises: a. a pressure-driven fluid displacement mechanism; b. a processor in communication with a memory; c. at least one camera (20); d. one or more sample holder supports (42) suitable to support one or more sample holders (41), the sample holders (41) preferably comprising at least one biological sample; e. one or more reagent vials (51) comprising a lid (52), wherein the lid (52) is movable between an open and a closed state; f. one air blowing unit comprising an air blower (60) and an air flow sensor, wherein the air blowing unit is configured to remove reagent from the sample and / or sample holders by blowing air over said reagent; g. preferably, one or more mixing vials; and h. a robotic arm (10) comprising at least one dispensing probe (80), wherein the dispensing probe (80) is fluidly connected to the pressure-driven fluid displacement mechanism; characterized in that the air blowing unit is further configured to blow air over the reagent only until a moisture level is left on the sample and / or sample holder (41) adequate to facilitate further reagent dispensing over said sample and / or sample holder (41), wherein the adequate moisture level is determined based on the flow of air sensed by the air flow sensor, and further characterized in that the memory in communication with the processor comprises data representing a set of instructions that when executed by the processor cause the processor to:¡'. receive one or more images taken by one of the at least one camera (20) comprising the image of one or more sample holders (41) and determine the presence, the position and / or the orientation of the sample holder (41) based on said images, wherein the determination of the position and / or orientation is made through geometric algorithms or through a first trained machine learning model, further wherein the set of instructions cause the processor to read one or more labels comprised in the image of the one or more sample holders (41) through the first or a second trained machine learning model, wherein said labels comprise at least data relating to a staining procedure;¡¡'. receive one or more images taken by one of the at least one camera (20) comprising the image of one or more reagent vials (51), and determine the presence of the one or more reagent vials (51) and / or the open or closed state of the lid (52) of said reagent vials based on said images, wherein the determination of the presence of the one or more reagent vials and / or the open or closed state of the lid is made through the first, the second or a third trained machine learning model, preferably wherein the set of instructions cause the processor to read one or more labels comprised in the image of the one or more reagent vials (51) through the first, second, third or a fourth trained machine learning model, wherein said labels comprise at least data relating to a reagent. wherein the dispensing by the dispensing probe (80) comprised in the robotic arm (10), via a pressure-driven fluid displacement, depends on the determination of the presence, position and / or orientation of the sample holder (41) and the reading of the one or more labels from step (¡'), and from the determination of the presence and open or closed state of the lid of one or more reagent vials (51) and optionally from the reading of the one or more labels, from step (¡¡').

2. The automatic staining device (1) according to claim 1 , further comprising a spreading unit (30) comprising a supporting element (32) and a spreading element (31), the spreading unit (30) preferably comprised in the robotic arm (10), wherein the longitudinal axis of said spreading element (31) is or can be placed parallel to the surface of the one or more sample holders (41) and / or the surface of the sample holder supports (42), and wherein the spreading element is supported by a supporting element (32) that can be displaced relative to the spreading element (31) in the direction perpendicular to the longitudinal axis of the spreading element (31) and parallel to the longitudinal axis of the supporting element (32), between a first configuration wherein the supporting element (32) supports the weight spreading element (31), and a second configuration wherein the spreading element (31) is not supported by the supporting element (32), such as when is supported by the sample holder (41) and / or the sample holder support (42).

3. The automatic staining device (1) according to any one of the previous claims, further comprising one or more inclination sensors to detect the inclination of the one or more sample holders with respect to the vertical direction],4. The automatic staining device (1) according to any one of the previous claims, wherein the sample holder supports (42) comprises one or more orifices, preferably a grid of atleast 6 orifices, to let the excess reagent flow through instead of letting the reagent fluid accumulate between the sample holder (41) and the sample holder support (42), preferably comprising at least 9 orifices, more preferably comprising a grid of at least 3x6 orifices, even more preferably comprising a grid of at least 3x12 orifices.

5. The automatic staining device (1) according to any one of the previous claims, wherein the set of instructions, when executed by the processor, further cause the processor to:¡¡¡'. receive one or more images taken by one of the at least one camera (20) comprising the image of one or more sample holders (41), which can be the same or different as the images received in step (¡'), provide said one or more images to the first, the second, the third or a fourth trained machine learning model, and determine the position and size of the sample in the one or more sample holders (41) based on the output received from the machine learning model; wherein the dispensing by the automatic staining device (1) further depends on the determination of the position and size of the sample in the one or more sample holders from step (¡¡¡’).

6. The automatic staining device (1) according to claim 5, wherein the automatic staining device (1) is configured to dispense an amount of reagent proportional to the size of the sample determined in step (¡¡¡’), and is further configured to dispense said reagent in a position of the sample holder (41) depending on the position of the sample determined in step (¡¡¡’).

7. The automatic staining device (1) according to any one of the previous claims, wherein the set of instructions when executed by the processor further cause the processor to: iv'. receive one or more images taken by one of the at least one camera (20) comprising the image of one or more mixing vials, provide said one or more images to the first, the second, the third, the fourth or a fifth trained machine learning model, and determine the presence and position of the one or more mixing vials based on the output received from the machine learning model; wherein the mixing by the automatic staining device (1) depends on the determination in step (iv’) of the presence and position of the one or more mixing vials.

8. The automatic staining device (1) according to any one of claims 2 to 7, wherein the longitudinal length of the spreading element is substantially the same as the width (45)of the sample holders (41) and / or sample holder supports (42), or has a difference in length with said width of ± 25%.

9. The automatic staining device (1) according to any one of claims 2 to 8, wherein the spreading element (31) is cylindrical and comprises a distal part (311), a proximal part (312), and a central part (313), wherein the diameter (D1) of the distal (311) and proximal part (312) is the same for both distal (311) and proximal (312) parts, and is bigger than the diameter (D2) of the central part (313), wherein the diameter (D1) of the distal (311) and proximal (312) parts is between 0.02 and 2 mm longer than the diameter (D2) of the central part (313), preferably is between 0.06 and 0.6 mm longer, more preferably is between 0.1 and 0.3 mm longer.

10. The automatic staining device (1) according to any one of the previous claims, wherein the air blower (60) has a shape and orientation adequate to evenly spread the reagents over the sample and / or sample holder (41), preferably such that the air is blowed at an angle between 10 to 80 degrees with respect to the normal to the surface of the sample holder, more preferably between 25 and 65 degrees, even more preferably between 35 and 5511 . The automatic staining device (1) according to any one of the previous claims, wherein the air blower (60) comprises one or more orifices (63) to blow the air, and: a. the longitudinal axis (62) of the air blower has a length (61) substantially the same as the width (45) of the sample holders (41) and / or sample holder supports (42), or has a difference in length with said width of ± 25%; and / or b. if the air blower comprises only one orifice, said orifice is elongated in the direction of the longitudinal axis (62) of the air blower (60), wherein the maximum length of said orifice is substantially the same as the width (45) of the sample holders (41) and / or sample holder supports (42), or has a difference in length with said width of ± 25%; and / or c. if the air blower comprises more than one orifice, said orifices are placed along the longitudinal axis (62) of the air blower (60), wherein the two more distanced orifices with respect to each other are separated such that at least part of one of the orifices is separated from at least part of the other orifice a distance substantially the same as the width (45) of the sample holders (41) and / or sample holder supports (42), or has a difference in length with said width of ± 25%.

12. The automatic staining device (1) according to any one of the previous claims, wherein one of the at least one cameras (20) is comprised in the robotic arm (10), and the central axis of the lens of said camera presents an inclination angle (21) with respect to the normal axis of the plane of the sample holders and / or sample holder supports of between 10 and 80 degrees, preferably between 25 and 65 degrees, more preferably between 30 and 60 degrees, even more preferably of around 45 degrees.

13. The automatic staining device (1) according to any one of the previous claims, wherein one of the one or more inclination sensors is configured to detect the inclination of the automatic staining device (1) with respect to the vertical direction, preferably wherein said inclination is detected as a function of time or compared with previous measurements to determine the stability of the automatic staining device.

14. The automatic staining device (1) according to any one of the previous claims, further comprising a washing receptacle (79) suitable to fit the length of the spreading element.

Citation Information

Patent Citations

  • Smear preparing device

    JP2007120969A

  • Automated tissue staining system and reagent container

    US20040033163A1

  • Method and apparatus for automated pre-treatment and processing of biological samples

    US20060148063A1

  • Removal of Embedding Medium

    US20090155907A1

  • Systems and methods for coverslipping slides

    US20230236211A1