import os
from langchain_openai import ChatOpenAI
from langchain_chroma import Chroma
from langchain_openai import OpenAIEmbeddings
from langchain_text_splitters import RecursiveCharacterTextSplitter
= ChatOpenAI(model="gpt-4o") llm
12 PDF Q&A System (Radio)
12.1 Load PDF
from langchain_community.document_loaders import PyPDFLoader
= PyPDFLoader("pdf/2024_Fleischner Society_Glossary of Terms for Thoracic Imaging.pdf")
loader
= loader.load()
docs print(len(docs))
55
0:3] docs[
[Document(metadata={'source': 'pdf/2024_Fleischner Society_Glossary of Terms for Thoracic Imaging.pdf', 'page': 0}, page_content='REVIEWS AND COMMENTARY • STATEMENTS AND GUIDELINES\nThis copy is for personal use only. T o order copies, contact reprints@rsna.orgThe present glossary of terms for thoracic imaging is the \nfourth prepared by members of the Fleischner Society \nand replaces the previous glossaries of terms for chest radi-\nography (1) and CT (2,3), respectively. The impetus to up-\ndate the previous version arose from an awareness that new \nterms have emerged, others have become obsolete, and the \nusage of some terms has either changed or become incon-\nsistent to a degree that warranted a new definition. The \nmethodology used for compiling this glossary is described \nin Appendix S1. Appendix S2 summarizes the terms in-\ncluded, excluded, and rearranged, compared with the pre-\nvious version of the glossary.\nThe intention of this latest glossary is not to be exhaus-\ntive but to focus on terms of clinical importance and those \nwhose meaning may be perceived as vague or ambigu-\nous. This focus is important to establish standardization \nof terminology and, thereby, to facilitate communications \nbetween radiologists and other clinicians. Moreover, the \ncurrent glossary aims for more stringent, consistent termi-\nnology required by structured reporting and essential for \nreasonably accurate searches in large databases (4,5).\nControversial or misused terms are also included, with \nrecommendations for appropriate usage. Whenever this is \nnot supported by objective evidence, the consensus prefer-\nence of the authors is clearly identified. In this regard, the \ncurrent glossary is not only an enumeration of terms and their definitions, but also a commentary regarding their \nuse.\nAs in previous versions, terms and techniques not spe-\ncific to thoracic imaging are not included. Despite sporadic \nreferences to fluorine 18 (18F) fluorodeoxyglucose PET/\nCT, most definitions continue to refer to chest radiogra-\nphy and CT, which remain the chief modalities used in \nthoracic imaging. The overall number of terms was kept \nalmost identical. However, several features are new.\nFirst, the glossary preserves the alphabetical order of \nterms, but several related terms are now grouped under \nthematic headings to allow a rapid overview for compar-\ning individual terms. The number of imaging signs was \nreduced, as these are comprehensively described elsewhere \n(6–8). Likewise, the number of eponyms was reduced to a \nminimum, and preference was given to descriptive terms, \nwhenever possible. Most terms continue to have a limited \nnumber of pertinent and updated references, but not all \nterms are referenced.\nSecond, for brevity, the glossary no longer includes sub-\ndivisions into pathology, radiographic, and CT definitions. \nEach term is now labeled to either reflect normal anatomy \n(anatomy), a physiologic concept (physiology), or an abnor-\nmal finding (pathology). It is important to emphasize that \nthis is a glossary of radiologic terms and that, while often \ngrounded in radiology-pathology correlations, terms labeled Members of the Fleischner Society have compiled a glossary of terms for thoracic imaging that replaces previous glossaries published in \n1984, 1996, and 2008, respectively. The impetus to update the previous version arose from multiple considerations. These include an \nawareness that new terms and concepts have emerged, others have become obsolete, and the usage of some terms has either changed or \nbecome inconsistent to a degree that warranted a new definition. This latest glossary is focused on terms of clinical importance and on \nthose whose meaning may be perceived as vague or ambiguous. As with previous versions, the aim of the present glossary is to establish \nstandardization of terminology for thoracic radiology and, thereby, to facilitate communications between radiologists and other clini-\ncians. Moreover, the present glossary aims to contribute to a more stringent use of terminology, increasingly required for structured \nreporting and accurate searches in large databases. Compared with the previous version, the number of images (chest radiography and \nCT) in the current version has substantially increased. The authors hope that this will enhance its educational and practical value.\nAll definitions and images are hyperlinked throughout the text. Click on each figure callout to view corresponding image.\n© RSNA, 2024 \nSupplemental material is available for this article.Fleischner Society: Glossary of Terms for Thoracic Imaging\nAlexander A. Bankier, MD, PhD • Heber MacMahon, MB, BCh • Thomas Colby, MD • \nPierre Alain Gevenois, MD, PhD • Jin Mo Goo, MD, PhD • Ann N.C. Leung, MD • \nDavid A. Lynch, MB, BCh • Cornelia M. Schaefer-Prokop, MD • Noriyuki Tomiyama, MD, PhD • \nWilliam D. Travis, MD • Johny A. Verschakelen, MD, PhD • Charles S. White, MD • David P . Naidich, MD\nFrom the Dept of Radiology, University of Massachusetts Memorial Health and University of Massachusetts Chan Medical School, 55 Lake Ave N, Worcester, MA 01655 \n(A.A.B.); Dept of Radiology, University of Chicago, Chicago, Ill (H.M.); Dept of Pathology, Mayo Clinic Scottsdale, Scottsdale, Ariz (T.C.); Dept of Pulmonology, \nUniversité Libre de Bruxelles, Brussels, Belgium (P .A.G.); Dept of Radiology, Seoul National University Hospital, Seoul, Korea (J.M.G.); Center for Academic Medicine, \nDept of Radiology, Stanford University, Palo Alto, Calif (A.N.C.L.); Dept of Radiology, National Jewish Medical and Research Center, Denver, Colo (D.A.L.); Dept \nof Radiology, Meander Medical Centre Amersfoort, Amersfoort, the Netherlands (C.M.S.P .); Dept of Radiology, Osaka University Graduate School of Medicine, Suita, \nJapan (N.T.); Dept of Pathology, Memorial Sloan Kettering Cancer Center, New York, NY (W.D.T.); Dept of Radiology, Catholic University Leuven, University Hospital \nGasthuisberg, Leuven, Belgium (J.A.V.); Dept of Diagnostic Radiology, University of Maryland Hospital, Baltimore, Md (C.S.W.); and Dept of Radiology, NYU Langone \nMedical Center/Tisch Hospital, New York, NY (D.P .N.). Received October 25, 2023; revision requested November 3; final revision received January 17, 2024; accepted \nJanuary 31. Address correspondence to A.A.B. (email: alexander.bankier@umassmemorial.org).\nConflicts of interest are listed at the end of this article.\nSee also the editorial by Adusumilli in the March 2024 issue.\nSee also the editorial by Bhalla in the February 2024 issue.\nSee also the editorial by Hariri et al in the March 2024 issue.\nSee also the editorial by Powell in the February 2024 issue.\nRadiology 2024; 310(2):232558 • https://doi.org/10.1148/radiol.232558 • Content code: \n'),
Document(metadata={'source': 'pdf/2024_Fleischner Society_Glossary of Terms for Thoracic Imaging.pdf', 'page': 1}, page_content='Fleischner Society: Glossary of Terms for Thoracic Imaging2 radiology.rsna.org \u2002 ■\u2002Radiology: Volume 3 10: Number 2—February 2024\nas pathology do not necessarily faithfully reflect definitions used \nby pathologists. Some terms are labeled as descriptors to differ-\nentiate them from terms that imply a radiologic diagnosis. Terms \ndescribed elsewhere are cross-referenced by an asterisk (*).\nThird, the glossary includes images for virtually all terms, and \nwe hope that this will increase its practical value. While images \nwere chosen to be typical for a given term, they are merely ex-\namples and do not represent the full range of possible imaging \nappearances, which may be found in the references of this glos-\nsary and in comprehensive textbooks.\nWe hope that this fourth edition of the Fleischner Society \nGlossary of Terms for Thoracic Imaging will be helpful for both \nradiologists and the respiratory medicine community at large. \nBecause terminology is evolving, the provided definitions should \nbe understood as a consensus proposal rather than strict rules. It \nis anticipated that systematic evaluations of the utilization of this \nglossary will be undertaken.\nAcinus (Pl. Acini) (Anatomy)\nThe acinus is a structural unit of the lung distal to the terminal \nbronchiole* and is supplied by a first-order respiratory bronchi-\nole, with a diameter of approximately 4-8 mm. The secondary \npulmonary lobule* contains between three and 25 acini. Within \nthe acinus, all parts are involved in gas exchange (ie, they contain \nalveoli). The acinus consists of respiratory bronchioles, alveolar \nducts, and alveoli. Normal acini are not visible radiologically but \nthe accumulation of pathologic material within acini may be \nseen as small ill-defined rounded opacities (opacity*), sometimes \ncalled “air space nodules” (9,10).\nAir Bronchogram (Pathology) [Descriptor] (Fig 1)\nAir bronchogram is the descriptive term for air-filled airways* \nwithin lung parenchyma* that is partially or completely air-\nless. The term implies (a) patency of proximal airways, and (b) \nevacuation of alveolar air by means of absorption (eg, in atelec-\ntasis*) or replacement (eg, fluid, tumor), or a combination of \nthese processes (11).\nAir Crescent (Pathology) [Descriptor] (Figs 2, 3)\nAir crescent is the descriptive term for a crescent-shaped air \ncollection between the wall of a cavity* and a mass* within \nthe cavity. It is often associated with the retraction of infarcted \nlung parenchyma* in angio-invasive aspergillosis or with the \ncolonization of preexisting cavities by Aspergillus or other \nfungi. In the latter case, the resulting fungus ball* may be mo-\nbile and change position with changes in the patient’s position. \nAir crescents can also occur due to necrotic tissue or a blood \nclot within a cavity* (12,13).\nAir Trapping (Physiology/Pathology) (Fig 4)\nAir trapping is the retention of air in lung parenchyma* distal \nto more proximal obstruction of one or several airways*. Air \ntrapping (also “gas trapping”) is seen at CT performed during \nor at the end of expiration. It is characterized by (a) a less-\nthan-normal increase in attenuation and (b) a less-than-normal \ndecrease in volume on expiration. Air trapping should only be called on expiratory CT examinations (14). Of note, areas of \nair trapping are typically sharply marginated, however distinc-\ntion between air trapping and decreased attenuation due to \nvascular occlusion, for example in chronic thromboembolic \ndisease, may be difficult (15,16). Air trapping is also frequently \nassociated with decreased focal perfusion (eg, caused by reac-\ntive vasoconstriction) (17–19).\nAirspace (Anatomy)\nAn airspace is the air- or gas-containing part of the lung paren-\nchyma*, including the respiratory bronchioles (bronchiole*), \nalveolar ducts, and alveoli, but excluding purely conductive air-\nways* such as terminal bronchioles. The term is used in conjunc-\ntion with opacity* and nodule* to designate the accumulation of \nmaterial within airspaces (20).\nAirways (Anatomy)\nThe airways are structural parts of the respiratory system that al-\nlow airflow. Conducting airways extend from the nares and buccal \nopening to the terminal bronchioles (bronchiole*). Large airways \ninclude the cervical and thoracic part of the trachea, as well as \nthe main, lobar, and segmental bronchi. Small airways include the \nsubsegmental bronchi to bronchioles with an internal diameter of \nless than 2 mm. Diseases of the central airways can often be visual-\nized directly at CT, whereas diseases of the peripheral airways often \nmanifest through indirect changes (eg, air trapping*) (21–23).\nAnatomic Distribution (Anatomy) (Figs 5–25)\n• Bronchocentric: adjacent to or involving the bronchi in \nthe axial interstitium* (Fig 5).\n• Centrilobular: centered on the core structures of the sec-\nondary pulmonary lobule* (Figs 6, 7). Often used to \ndescribe the distribution of nodules (nodule*) or mi-\ncronodules (micronodule*).\n• Diffuse: distributed throughout a lobe* or lobes without \nparticular regional predominance, for example be-\ntween central and peripheral parts of the lung (Fig 8).\n• Endobronchial: located within the lumen of a bronchus \n(Figs 9, 10).\n• Extrapleural: external to the pleura, without directly in-\nvolving the pleura* or the pleural space (Fig 11).\n• Fissural: refers to a lesion or disease that arises from or in-\nvolves the fissure* (Fig 12). A lesion or disease that has \ndirect contact with the fissure*, but does not arise from \nit, should be called “perifissural.”\n• Focal: confined to one distinct area (Fig 13).\n• Geographic: distributed in a manner resembling the out-\nline of regions on a map. The term implies well-defined \nmargins between areas of differing attenuation (Fig 14).'),
Document(metadata={'source': 'pdf/2024_Fleischner Society_Glossary of Terms for Thoracic Imaging.pdf', 'page': 2}, page_content='Bankier et alRadiology: Volume 3 10: Number 2—February 2024 \u2002 ■\u2002radiology.rsna.org 3• Multifocal: involving two or more distinct areas (Figs \n15, 16).\n• Peribronchovascular: distributed along the bronchovas-\ncular bundles (Figs 17, 18).\n• Perilobular: Arcade-like or curvilinear opacities that \ncan be related to the margins of secondary pulmo-\nnary lobules (Figs 19, 20).\n• Perilymphatic: distributed along lymphatic vessels (Figs \n21, 22). \n• Pleural: refers to a lesion or disease that arises from or \ninvolves the pleura*. A lesion or disease that has \ncontact with the pleura*, but does not arise from it, \nshould be called pleura-based. The term subpleural \nshould only be used for lesions or diseases in prox-\nimity to the pleura*, but without direct contact to \nit. Because this term has been attributed variable \nmeanings in the literature, the term peripheral is pre-\nferred to describe such lesions or diseases. Of note, \nimaging cannot always determine whether a given \nlesion is located between two layers of pleura or \nwithin the pleura, or in the parenchyma and directly \ncontiguous to the pleura (Figs 23–25).\nThe prefix juxta- has been used inconsistently to describe le-\nsions that are variously in proximity or in contact with the pleura* \nor a fissure* (juxtafissural, juxtapleural) (24). We recommend \ninstead using the more stringent terminology described above.\nAortopulmonary Window (Anatomy) (Fig 26)\nThe aortopulmonary window is a mediastinal compartment \ndelimited anteriorly by the ascending aorta, posteriorly by the \ndescending aorta, cranially by the aortic arch, caudally by the left \npulmonary artery, medially by the trachea and the lateral wall of \nthe left main bronchus, and laterally by the medial pleura* cover-\ning the left lung. The aortopulmonary window contains lymph \nnodes (lymph node*) and connective tissue and is traversed by \nthe left phrenic nerve, the left vagus nerve, the left recurrent la-\nryngeal nerve, and the left bronchial arteries. It is separated into \na medial and lateral part by the ligamentum arteriosum (25).\nApical Cap (Pathology) (Fig 27)\nApical caps are cap-like rims at the lung apices, often bilateral, \nusually caused by pulmonary and/or pleural fibrosis* displac-\ning extrapleural fat. Chronic ischemia causing a plaque of elas-\ntotic fibrosis of the visceral pleura*, with or without subpleural \nlung parenchyma*, has been suggested as the potential patho-\ngenesis, which is variably associated with aging. In addition, \napical caps can be caused by fluid collections associated with \ninfection, neoplasms, or trauma, either extrapleural or within \nthe pleural space. A left apical cap can be caused by hematoma, \nsuch as resulting from aortic rupture (26–28). Moderate or se-\nvere apical pleural caps also can be seen in upper lobe fibrosis, \nincluding pleuroparenchymal fibroelastosis (29).Architectural Distortion (Pathology) (Fig 28)\nArchitectural distortion is characterized by the focal or dif-\nfuse derangement of the normal pulmonary anatomy, with \nabnormal displacement or disruption of airways*, vessels, and \ninterstitium*. It is typically accompanied by volume loss* and \nis commonly seen in fibrotic lung diseases (30,31).\nAsbestosis (Pathology) (Fig 29)\nAsbestosis is an occupational lung disease characterized by \nlower-lobe predominant pulmonary fibrosis caused by inhala-\ntion of asbestos fibers. Once established, fibrosis can progress. \nHowever, even without progression, the risk of lung cancer is \nincreased. In addition, asbestos exposure increases the risk of \nmesothelioma. However, asbestosis is usually associated with \nhigh levels of asbestos exposure, in distinction to mesothe-\nlioma. Although pleural plaques, calcified or noncalcified, \nmay also be identified, their presence is not essential for the \ndiagnosis (pleural plaque*) (32,33).\nAspiration (Pathology)\nAspiration is the unintended inhalation of solid and/or fluid \nsubstances (“aspirate”). Depending on its location and ex-\ntent within the airways*, the aspirate can cause atelectasis*, \ninflammation (“aspiration pneumonitis/bronchiolitis”), or \ninfection (“aspiration pneumonia”). Changes caused by aspi-\nration are most commonly seen in the posterior portions of \nthe lungs and predispose to infection with anaerobic bacteria. \nSequelae of aspiration, including scarring and bronchiectasis, \ncan be seen in variable anatomic locations but tend to follow \nthe direction of gravity (34,35).\nAtelectasis (Pathology) (Figs 30–40)\nAtelectasis is a partial or complete collapse* of the lung. Atel-\nectasis can be caused by loss of negative pressure in the pleural \nspace and/or by compression of lung parenchyma* (eg, by \npleural effusions*), by resorption of air following obstruction \n(eg, by a foreign body or a neoplasm), or by an increase in al-\nveolar surface tension (eg, by surfactant dysfunction). Atelec-\ntasis shows lower volume and higher attenuation than normal \nlung tissue and is often associated with abnormal displace-\nment of fissures (fissure*), bronchi, vessels, hyperinflation of \nadjacent lobes (lobe*), or obscuration of cardiac and medias-\ntinal interfaces (36,37).\n• Lobar: atelectasis of an entire pulmonary lobe* (Figs \n30–37).\n• Linear (formerly “plate-like” or “band-like”): descriptor \nfor local atelectasis with a linear, plate-like, or band-\nlike shape (Figs 38, 39).\nOften seen in dependent lung regions, paralleling the hemi-\ndiaphragms on chest radiographs and the chest wall on CT \nexaminations. Of note, the geometric definition of “line” re-\nfers to a one-dimensional structure. While the cross-sectional \nappearance of an atelectasis may appear linear, the atelectasis \nitself has greater dimensionality than a line.')]
## Example content
for line in [doc.page_content for doc in docs[0:2]]:
print(line)
REVIEWS AND COMMENTARY • STATEMENTS AND GUIDELINES
This copy is for personal use only. T o order copies, contact reprints@rsna.orgThe present glossary of terms for thoracic imaging is the
fourth prepared by members of the Fleischner Society
and replaces the previous glossaries of terms for chest radi-
ography (1) and CT (2,3), respectively. The impetus to up-
date the previous version arose from an awareness that new
terms have emerged, others have become obsolete, and the
usage of some terms has either changed or become incon-
sistent to a degree that warranted a new definition. The
methodology used for compiling this glossary is described
in Appendix S1. Appendix S2 summarizes the terms in-
cluded, excluded, and rearranged, compared with the pre-
vious version of the glossary.
The intention of this latest glossary is not to be exhaus-
tive but to focus on terms of clinical importance and those
whose meaning may be perceived as vague or ambigu-
ous. This focus is important to establish standardization
of terminology and, thereby, to facilitate communications
between radiologists and other clinicians. Moreover, the
current glossary aims for more stringent, consistent termi-
nology required by structured reporting and essential for
reasonably accurate searches in large databases (4,5).
Controversial or misused terms are also included, with
recommendations for appropriate usage. Whenever this is
not supported by objective evidence, the consensus prefer-
ence of the authors is clearly identified. In this regard, the
current glossary is not only an enumeration of terms and their definitions, but also a commentary regarding their
use.
As in previous versions, terms and techniques not spe-
cific to thoracic imaging are not included. Despite sporadic
references to fluorine 18 (18F) fluorodeoxyglucose PET/
CT, most definitions continue to refer to chest radiogra-
phy and CT, which remain the chief modalities used in
thoracic imaging. The overall number of terms was kept
almost identical. However, several features are new.
First, the glossary preserves the alphabetical order of
terms, but several related terms are now grouped under
thematic headings to allow a rapid overview for compar-
ing individual terms. The number of imaging signs was
reduced, as these are comprehensively described elsewhere
(6–8). Likewise, the number of eponyms was reduced to a
minimum, and preference was given to descriptive terms,
whenever possible. Most terms continue to have a limited
number of pertinent and updated references, but not all
terms are referenced.
Second, for brevity, the glossary no longer includes sub-
divisions into pathology, radiographic, and CT definitions.
Each term is now labeled to either reflect normal anatomy
(anatomy), a physiologic concept (physiology), or an abnor-
mal finding (pathology). It is important to emphasize that
this is a glossary of radiologic terms and that, while often
grounded in radiology-pathology correlations, terms labeled Members of the Fleischner Society have compiled a glossary of terms for thoracic imaging that replaces previous glossaries published in
1984, 1996, and 2008, respectively. The impetus to update the previous version arose from multiple considerations. These include an
awareness that new terms and concepts have emerged, others have become obsolete, and the usage of some terms has either changed or
become inconsistent to a degree that warranted a new definition. This latest glossary is focused on terms of clinical importance and on
those whose meaning may be perceived as vague or ambiguous. As with previous versions, the aim of the present glossary is to establish
standardization of terminology for thoracic radiology and, thereby, to facilitate communications between radiologists and other clini-
cians. Moreover, the present glossary aims to contribute to a more stringent use of terminology, increasingly required for structured
reporting and accurate searches in large databases. Compared with the previous version, the number of images (chest radiography and
CT) in the current version has substantially increased. The authors hope that this will enhance its educational and practical value.
All definitions and images are hyperlinked throughout the text. Click on each figure callout to view corresponding image.
© RSNA, 2024
Supplemental material is available for this article.Fleischner Society: Glossary of Terms for Thoracic Imaging
Alexander A. Bankier, MD, PhD • Heber MacMahon, MB, BCh • Thomas Colby, MD •
Pierre Alain Gevenois, MD, PhD • Jin Mo Goo, MD, PhD • Ann N.C. Leung, MD •
David A. Lynch, MB, BCh • Cornelia M. Schaefer-Prokop, MD • Noriyuki Tomiyama, MD, PhD •
William D. Travis, MD • Johny A. Verschakelen, MD, PhD • Charles S. White, MD • David P . Naidich, MD
From the Dept of Radiology, University of Massachusetts Memorial Health and University of Massachusetts Chan Medical School, 55 Lake Ave N, Worcester, MA 01655
(A.A.B.); Dept of Radiology, University of Chicago, Chicago, Ill (H.M.); Dept of Pathology, Mayo Clinic Scottsdale, Scottsdale, Ariz (T.C.); Dept of Pulmonology,
Université Libre de Bruxelles, Brussels, Belgium (P .A.G.); Dept of Radiology, Seoul National University Hospital, Seoul, Korea (J.M.G.); Center for Academic Medicine,
Dept of Radiology, Stanford University, Palo Alto, Calif (A.N.C.L.); Dept of Radiology, National Jewish Medical and Research Center, Denver, Colo (D.A.L.); Dept
of Radiology, Meander Medical Centre Amersfoort, Amersfoort, the Netherlands (C.M.S.P .); Dept of Radiology, Osaka University Graduate School of Medicine, Suita,
Japan (N.T.); Dept of Pathology, Memorial Sloan Kettering Cancer Center, New York, NY (W.D.T.); Dept of Radiology, Catholic University Leuven, University Hospital
Gasthuisberg, Leuven, Belgium (J.A.V.); Dept of Diagnostic Radiology, University of Maryland Hospital, Baltimore, Md (C.S.W.); and Dept of Radiology, NYU Langone
Medical Center/Tisch Hospital, New York, NY (D.P .N.). Received October 25, 2023; revision requested November 3; final revision received January 17, 2024; accepted
January 31. Address correspondence to A.A.B. (email: alexander.bankier@umassmemorial.org).
Conflicts of interest are listed at the end of this article.
See also the editorial by Adusumilli in the March 2024 issue.
See also the editorial by Bhalla in the February 2024 issue.
See also the editorial by Hariri et al in the March 2024 issue.
See also the editorial by Powell in the February 2024 issue.
Radiology 2024; 310(2):232558 • https://doi.org/10.1148/radiol.232558 • Content code:
Fleischner Society: Glossary of Terms for Thoracic Imaging2 radiology.rsna.org ■ Radiology: Volume 3 10: Number 2—February 2024
as pathology do not necessarily faithfully reflect definitions used
by pathologists. Some terms are labeled as descriptors to differ-
entiate them from terms that imply a radiologic diagnosis. Terms
described elsewhere are cross-referenced by an asterisk (*).
Third, the glossary includes images for virtually all terms, and
we hope that this will increase its practical value. While images
were chosen to be typical for a given term, they are merely ex-
amples and do not represent the full range of possible imaging
appearances, which may be found in the references of this glos-
sary and in comprehensive textbooks.
We hope that this fourth edition of the Fleischner Society
Glossary of Terms for Thoracic Imaging will be helpful for both
radiologists and the respiratory medicine community at large.
Because terminology is evolving, the provided definitions should
be understood as a consensus proposal rather than strict rules. It
is anticipated that systematic evaluations of the utilization of this
glossary will be undertaken.
Acinus (Pl. Acini) (Anatomy)
The acinus is a structural unit of the lung distal to the terminal
bronchiole* and is supplied by a first-order respiratory bronchi-
ole, with a diameter of approximately 4-8 mm. The secondary
pulmonary lobule* contains between three and 25 acini. Within
the acinus, all parts are involved in gas exchange (ie, they contain
alveoli). The acinus consists of respiratory bronchioles, alveolar
ducts, and alveoli. Normal acini are not visible radiologically but
the accumulation of pathologic material within acini may be
seen as small ill-defined rounded opacities (opacity*), sometimes
called “air space nodules” (9,10).
Air Bronchogram (Pathology) [Descriptor] (Fig 1)
Air bronchogram is the descriptive term for air-filled airways*
within lung parenchyma* that is partially or completely air-
less. The term implies (a) patency of proximal airways, and (b)
evacuation of alveolar air by means of absorption (eg, in atelec-
tasis*) or replacement (eg, fluid, tumor), or a combination of
these processes (11).
Air Crescent (Pathology) [Descriptor] (Figs 2, 3)
Air crescent is the descriptive term for a crescent-shaped air
collection between the wall of a cavity* and a mass* within
the cavity. It is often associated with the retraction of infarcted
lung parenchyma* in angio-invasive aspergillosis or with the
colonization of preexisting cavities by Aspergillus or other
fungi. In the latter case, the resulting fungus ball* may be mo-
bile and change position with changes in the patient’s position.
Air crescents can also occur due to necrotic tissue or a blood
clot within a cavity* (12,13).
Air Trapping (Physiology/Pathology) (Fig 4)
Air trapping is the retention of air in lung parenchyma* distal
to more proximal obstruction of one or several airways*. Air
trapping (also “gas trapping”) is seen at CT performed during
or at the end of expiration. It is characterized by (a) a less-
than-normal increase in attenuation and (b) a less-than-normal
decrease in volume on expiration. Air trapping should only be called on expiratory CT examinations (14). Of note, areas of
air trapping are typically sharply marginated, however distinc-
tion between air trapping and decreased attenuation due to
vascular occlusion, for example in chronic thromboembolic
disease, may be difficult (15,16). Air trapping is also frequently
associated with decreased focal perfusion (eg, caused by reac-
tive vasoconstriction) (17–19).
Airspace (Anatomy)
An airspace is the air- or gas-containing part of the lung paren-
chyma*, including the respiratory bronchioles (bronchiole*),
alveolar ducts, and alveoli, but excluding purely conductive air-
ways* such as terminal bronchioles. The term is used in conjunc-
tion with opacity* and nodule* to designate the accumulation of
material within airspaces (20).
Airways (Anatomy)
The airways are structural parts of the respiratory system that al-
low airflow. Conducting airways extend from the nares and buccal
opening to the terminal bronchioles (bronchiole*). Large airways
include the cervical and thoracic part of the trachea, as well as
the main, lobar, and segmental bronchi. Small airways include the
subsegmental bronchi to bronchioles with an internal diameter of
less than 2 mm. Diseases of the central airways can often be visual-
ized directly at CT, whereas diseases of the peripheral airways often
manifest through indirect changes (eg, air trapping*) (21–23).
Anatomic Distribution (Anatomy) (Figs 5–25)
• Bronchocentric: adjacent to or involving the bronchi in
the axial interstitium* (Fig 5).
• Centrilobular: centered on the core structures of the sec-
ondary pulmonary lobule* (Figs 6, 7). Often used to
describe the distribution of nodules (nodule*) or mi-
cronodules (micronodule*).
• Diffuse: distributed throughout a lobe* or lobes without
particular regional predominance, for example be-
tween central and peripheral parts of the lung (Fig 8).
• Endobronchial: located within the lumen of a bronchus
(Figs 9, 10).
• Extrapleural: external to the pleura, without directly in-
volving the pleura* or the pleural space (Fig 11).
• Fissural: refers to a lesion or disease that arises from or in-
volves the fissure* (Fig 12). A lesion or disease that has
direct contact with the fissure*, but does not arise from
it, should be called “perifissural.”
• Focal: confined to one distinct area (Fig 13).
• Geographic: distributed in a manner resembling the out-
line of regions on a map. The term implies well-defined
margins between areas of differing attenuation (Fig 14).
12.2 Split & Index
12.2.0.1 Chroma
= RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
text_splitter = text_splitter.split_documents(docs)
splits
= Chroma.from_documents(documents=splits,
vectorstore =OpenAIEmbeddings(),
embedding# Save
="db2") persist_directory
# Now we can load the persisted database from disk, and use it as normal.
= Chroma(persist_directory="db2", embedding_function=OpenAIEmbeddings())
vectorstore vectorstore
<langchain_chroma.vectorstores.Chroma at 0x16a040f10>
= vectorstore.as_retriever()
retriever retriever
VectorStoreRetriever(tags=['Chroma', 'OpenAIEmbeddings'], vectorstore=<langchain_chroma.vectorstores.Chroma object at 0x16a040f10>)
12.2.1 Grobid
https://python.langchain.com/v0.2/docs/integrations/document_loaders/grobid/
from langchain_community.document_loaders.generic import GenericLoader
from langchain_community.document_loaders.parsers import GrobidParser
= GenericLoader.from_filesystem(
loader "pdf/2024_Fleischner Society_Glossary of Terms for Thoracic Imaging.pdf",
=GrobidParser(segment_sentences=False),
parser
)= loader.load() docs_gro
GROBID server does not appear up and running, please ensure Grobid is installed and the server is running
--------------------------------------------------------------------------- ConnectionRefusedError Traceback (most recent call last) File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/urllib3/connection.py:198, in HTTPConnection._new_conn(self) 197 try: --> 198 sock = connection.create_connection( 199 (self._dns_host, self.port), 200 self.timeout, 201 source_address=self.source_address, 202 socket_options=self.socket_options, 203 ) 204 except socket.gaierror as e: File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/urllib3/util/connection.py:85, in create_connection(address, timeout, source_address, socket_options) 84 try: ---> 85 raise err 86 finally: 87 # Break explicitly a reference cycle File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/urllib3/util/connection.py:73, in create_connection(address, timeout, source_address, socket_options) 72 sock.bind(source_address) ---> 73 sock.connect(sa) 74 # Break explicitly a reference cycle ConnectionRefusedError: [Errno 61] Connection refused The above exception was the direct cause of the following exception: NewConnectionError Traceback (most recent call last) File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/urllib3/connectionpool.py:793, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw) 792 # Make the request on the HTTPConnection object --> 793 response = self._make_request( 794 conn, 795 method, 796 url, 797 timeout=timeout_obj, 798 body=body, 799 headers=headers, 800 chunked=chunked, 801 retries=retries, 802 response_conn=response_conn, 803 preload_content=preload_content, 804 decode_content=decode_content, 805 **response_kw, 806 ) 808 # Everything went great! File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/urllib3/connectionpool.py:496, in HTTPConnectionPool._make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length) 495 try: --> 496 conn.request( 497 method, 498 url, 499 body=body, 500 headers=headers, 501 chunked=chunked, 502 preload_content=preload_content, 503 decode_content=decode_content, 504 enforce_content_length=enforce_content_length, 505 ) 507 # We are swallowing BrokenPipeError (errno.EPIPE) since the server is 508 # legitimately able to close the connection after sending a valid response. 509 # With this behaviour, the received response is still readable. File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/urllib3/connection.py:400, in HTTPConnection.request(self, method, url, body, headers, chunked, preload_content, decode_content, enforce_content_length) 399 self.putheader(header, value) --> 400 self.endheaders() 402 # If we're given a body we start sending that in chunks. File ~/.pyenv/versions/3.10.10/lib/python3.10/http/client.py:1277, in HTTPConnection.endheaders(self, message_body, encode_chunked) 1276 raise CannotSendHeader() -> 1277 self._send_output(message_body, encode_chunked=encode_chunked) File ~/.pyenv/versions/3.10.10/lib/python3.10/http/client.py:1037, in HTTPConnection._send_output(self, message_body, encode_chunked) 1036 del self._buffer[:] -> 1037 self.send(msg) 1039 if message_body is not None: 1040 1041 # create a consistent interface to message_body File ~/.pyenv/versions/3.10.10/lib/python3.10/http/client.py:975, in HTTPConnection.send(self, data) 974 if self.auto_open: --> 975 self.connect() 976 else: File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/urllib3/connection.py:238, in HTTPConnection.connect(self) 237 def connect(self) -> None: --> 238 self.sock = self._new_conn() 239 if self._tunnel_host: 240 # If we're tunneling it means we're connected to our proxy. File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/urllib3/connection.py:213, in HTTPConnection._new_conn(self) 212 except OSError as e: --> 213 raise NewConnectionError( 214 self, f"Failed to establish a new connection: {e}" 215 ) from e 217 # Audit hooks are only available in Python 3.8+ NewConnectionError: <urllib3.connection.HTTPConnection object at 0x10f372740>: Failed to establish a new connection: [Errno 61] Connection refused The above exception was the direct cause of the following exception: MaxRetryError Traceback (most recent call last) File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/requests/adapters.py:486, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies) 485 try: --> 486 resp = conn.urlopen( 487 method=request.method, 488 url=url, 489 body=request.body, 490 headers=request.headers, 491 redirect=False, 492 assert_same_host=False, 493 preload_content=False, 494 decode_content=False, 495 retries=self.max_retries, 496 timeout=timeout, 497 chunked=chunked, 498 ) 500 except (ProtocolError, OSError) as err: File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/urllib3/connectionpool.py:847, in HTTPConnectionPool.urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, preload_content, decode_content, **response_kw) 845 new_e = ProtocolError("Connection aborted.", new_e) --> 847 retries = retries.increment( 848 method, url, error=new_e, _pool=self, _stacktrace=sys.exc_info()[2] 849 ) 850 retries.sleep() File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/urllib3/util/retry.py:515, in Retry.increment(self, method, url, response, error, _pool, _stacktrace) 514 reason = error or ResponseError(cause) --> 515 raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] 517 log.debug("Incremented Retry for (url='%s'): %r", url, new_retry) MaxRetryError: HTTPConnectionPool(host='localhost', port=8070): Max retries exceeded with url: /api/processFulltextDocument (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10f372740>: Failed to establish a new connection: [Errno 61] Connection refused')) During handling of the above exception, another exception occurred: ConnectionError Traceback (most recent call last) File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/langchain_community/document_loaders/parsers/grobid.py:30, in GrobidParser.__init__(self, segment_sentences, grobid_server) 29 try: ---> 30 requests.get(grobid_server) 31 except requests.exceptions.RequestException: File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/requests/api.py:73, in get(url, params, **kwargs) 63 r"""Sends a GET request. 64 65 :param url: URL for the new :class:`Request` object. (...) 70 :rtype: requests.Response 71 """ ---> 73 return request("get", url, params=params, **kwargs) File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/requests/api.py:59, in request(method, url, **kwargs) 58 with sessions.Session() as session: ---> 59 return session.request(method=method, url=url, **kwargs) File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/requests/sessions.py:589, in Session.request(self, method, url, params, data, headers, cookies, files, auth, timeout, allow_redirects, proxies, hooks, stream, verify, cert, json) 588 send_kwargs.update(settings) --> 589 resp = self.send(prep, **send_kwargs) 591 return resp File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/requests/sessions.py:703, in Session.send(self, request, **kwargs) 702 # Send the request --> 703 r = adapter.send(request, **kwargs) 705 # Total elapsed time of the request (approximately) File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/requests/adapters.py:519, in HTTPAdapter.send(self, request, stream, timeout, verify, cert, proxies) 517 raise SSLError(e, request=request) --> 519 raise ConnectionError(e, request=request) 521 except ClosedPoolError as e: ConnectionError: HTTPConnectionPool(host='localhost', port=8070): Max retries exceeded with url: /api/processFulltextDocument (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10f372740>: Failed to establish a new connection: [Errno 61] Connection refused')) During handling of the above exception, another exception occurred: ServerUnavailableException Traceback (most recent call last) Cell In[3], line 3 1 loader = GenericLoader.from_filesystem( 2 "pdf/2024_Fleischner Society_Glossary of Terms for Thoracic Imaging.pdf", ----> 3 parser=GrobidParser(segment_sentences=False), 4 ) 5 docs_gro = loader.load() File ~/.pyenv/versions/3.10.10/lib/python3.10/site-packages/langchain_community/document_loaders/parsers/grobid.py:36, in GrobidParser.__init__(self, segment_sentences, grobid_server) 31 except requests.exceptions.RequestException: 32 logger.error( 33 "GROBID server does not appear up and running, \ 34 please ensure Grobid is installed and the server is running" 35 ) ---> 36 raise ServerUnavailableException ServerUnavailableException:
12.3 Prompt
# set the LANGCHAIN_API_KEY environment variable (create key in settings)
from langchain import hub
= hub.pull("rlm/rag-prompt") prompt
from langchain.chains import create_retrieval_chain
from langchain.chains.combine_documents import create_stuff_documents_chain
from langchain_core.prompts import ChatPromptTemplate
= """You are an assistant for question-answering tasks. Use the following pieces of retrieved context to answer the question. If you don't know the answer, just say that you don't know. Format your answer as headings, bullets, or numbering as appropriate. Keep the answer concise.
system_prompt Context: {context}
"""
= ChatPromptTemplate.from_messages(
prompt
["system", system_prompt),
("human", "{input}"),
(
]
)
"context": "C", "input": "Hi"}) prompt.invoke({
ChatPromptValue(messages=[SystemMessage(content="You are an assistant for question-answering tasks. Use the following pieces of retrieved context to answer the question. If you don't know the answer, just say that you don't know. Format your answer as headings, bullets, or numbering as appropriate. Keep the answer concise.\nContext: C\n"), HumanMessage(content='Hi')])
12.4 Chain
= create_stuff_documents_chain(llm, prompt)
question_answer_chain question_answer_chain
RunnableBinding(bound=RunnableBinding(bound=RunnableAssign(mapper={
context: RunnableLambda(format_docs)
}), config={'run_name': 'format_inputs'})
| ChatPromptTemplate(input_variables=['context', 'input'], messages=[SystemMessagePromptTemplate(prompt=PromptTemplate(input_variables=['context'], template="You are an assistant for question-answering tasks. Use the following pieces of retrieved context to answer the question. If you don't know the answer, just say that you don't know. Format your answer as headings, bullets, or numbering as appropriate. Keep the answer concise.\nContext: {context}\n")), HumanMessagePromptTemplate(prompt=PromptTemplate(input_variables=['input'], template='{input}'))])
| ChatOpenAI(client=<openai.resources.chat.completions.Completions object at 0x1204f1210>, async_client=<openai.resources.chat.completions.AsyncCompletions object at 0x1204f2fe0>, model_name='gpt-4o', openai_api_key=SecretStr('**********'), openai_proxy='')
| StrOutputParser(), config={'run_name': 'stuff_documents_chain'})
12.5 Execute
= create_retrieval_chain(retriever, question_answer_chain)
rag_chain = rag_chain.invoke({"input": "What is Architectural distortion?"})
results results
{'input': 'What is Architectural distortion?',
'context': [Document(metadata={'page': 21, 'source': 'pdf/2024_Fleischner Society_Glossary of Terms for Thoracic Imaging.pdf'}, page_content='Fleischner Society: Glossary of Terms for Thoracic Imaging22 radiology.rsna.org \u2002 ■\u2002Radiology: Volume 3 10: Number 2—February 2024\nFigure 26: Aortopulmonary window: (A) Frontal chest \nradiograph and (B) coronal CT image reconstruction in the \nsame patient show aortopulmonary window (arrow).\nclick to return to page 3\nFigure 27: Apical cap: (A) Frontal chest radiograph and (B) \ncoronal CT image reconstruction in the same patient show bilateral \napical caps (arrows).\nclick to return to page 3\nFigure 28: Architectural distortion: Transverse CT images of the (A, B) right and (C) left lung of three different patients show traction bronchiectasis (solid \narrows). Note the presence of coexisting fibrosis and architectural distortion (open arrow in B and C ). click to return to page 3, page 4'),
Document(metadata={'page': 7, 'source': 'pdf/2024_Fleischner Society_Glossary of Terms for Thoracic Imaging.pdf'}, page_content='micronodules is different from the concept of a micronodular \npattern*, described elsewhere in the text.\nMosaic Attenuation (Pathology) (Fig 88)\nFor the description, see pattern, mosaic*. The mosaic attenu-\nation CT pattern* can be caused by obliterative small airways \ndisease*, occlusive vascular disease, multifocal interstitial \nlung disease*, or by a combination of the above. In oblitera-\ntive small airways disease and in occlusive vascular disease, \nthe lower attenuation areas are abnormally hypodense and \nthe higher attenuation abnormally hyperdense, reflecting dif-\nferences in vascular perfusion, whereas in multifocal inter-\nstitial lung disease* the lower attenuation areas are normal \nand the higher attenuation areas abnormal. Mosaic attenu-\nation should only be described on CT examinations per-\nformed in full inspiration. “Mosaic perfusion” refers to the \nmosaic pattern caused by local variations in lung perfusion'),
Document(metadata={'page': 6, 'source': 'pdf/2024_Fleischner Society_Glossary of Terms for Thoracic Imaging.pdf'}, page_content='Bankier et alRadiology: Volume 3 10: Number 2—February 2024 \u2002 ■\u2002radiology.rsna.org 7complete effacement of normal lung architecture and usually \noccurs with other signs of pulmonary fibrosis*, including trac-\ntion bronchiolectasis*. Of note, honeycombing can also exist \nat the microscopic level and does not necessarily reflect the CT \nappearance of honeycombing (81). Care should be exercised \nwhen using the term honeycombing, as it implies substantial \nfibrosis (30,82), and the term should only be used if other signs \nof fibrosis are present.\nInfarction (Pathology) (Fig 56)\nInfarction is the result of parenchymal damage from vascular \nobstruction or occlusion, caused by either emboli or patho-\nlogic changes of the vessel wall. At imaging, a pulmonary in-\nfarct is typically a triangular, dome-, or wedge-shaped opac-\nity*, with the base abutting the pleura* and the apex directed \ntoward the hilum*. The opacity reflects local edema, hemor-'),
Document(metadata={'page': 1, 'source': 'pdf/2024_Fleischner Society_Glossary of Terms for Thoracic Imaging.pdf'}, page_content='• Focal: confined to one distinct area (Fig 13).\n• Geographic: distributed in a manner resembling the out-\nline of regions on a map. The term implies well-defined \nmargins between areas of differing attenuation (Fig 14).')],
'answer': '### Architectural Distortion\n\n- **Definition**: Architectural distortion refers to the abnormal appearance of lung tissue, where the normal pulmonary architecture is disrupted.\n- **Associated Features**: It often occurs with other signs of pulmonary fibrosis.\n- **Imaging Findings**:\n - **CT Images**: It can be observed in transverse CT images as areas with traction bronchiectasis and coexisting fibrosis.\n - **Indications**: Presence of traction bronchiectasis (solid arrows in images) and fibrosis (open arrows in images).\n'}
print(results["answer"])
### Architectural Distortion
- **Definition**: Architectural distortion refers to the abnormal appearance of lung tissue, where the normal pulmonary architecture is disrupted.
- **Associated Features**: It often occurs with other signs of pulmonary fibrosis.
- **Imaging Findings**:
- **CT Images**: It can be observed in transverse CT images as areas with traction bronchiectasis and coexisting fibrosis.
- **Indications**: Presence of traction bronchiectasis (solid arrows in images) and fibrosis (open arrows in images).