Medical Imaging History

            Medical Imaging is a young field.

            In 1895, Wilhelm Roentgen discovered x-rays.

            The primary focus for much of this development has been to improve the quality of the images for humans to evaluate.Only recently has computer technology become

sufficiently sophisticated to assist in the process of diagnosis.

            Early in the twentieth century, a Czech mathematician named Johann Radon dervied a transform for reconstructing corss-sectional information from a series of planar projections taken from around an object, While this powerful theory had been know for overy fifty years, the ability to compute the transform on real data was not possible until digital computers began to mature in 1970s.

           Imaging in 3D emerged in 1972 when x-ray computed tomography(CT) was developed independently by Godfrey Hounsfield and Alan Cormack. These innovators later shared the 1979 Nobel Prize in Medicine.

           While techniques for using x-rays in medical imaging were being refined, organic chemists had been exploring the uses of nuclear magnetic resonance(NMR) to analyze chemical samples. Felix Bloch and Edward Purcell were studying NMR in the mid 1940s. Together, they shared the Nobel Prize in Physics in 1952.

(Kriging_NSGA2)克里金模型结合多目标遗传算法求最优因变量及对应的最佳自变量组合研究(Matlab代码实现)内容概要:本文介绍了克里金模型(Kriging)与多目标遗传算法NSGA-II相结合的方法,用于求解最优因变量及其对应的最佳自变量组合,并提供了完整的Matlab代码实现。该方法首先利用克里金模型构建高精度的代理模型,逼近复杂的非线性系统响应,减少计算成本;随后结合NSGA-II算法进行多目标优化,搜索帕累托前沿解集,从而获得多个最优折衷方案。文中详细阐述了代理模型构建、算法集成流程及参数设置,适用于工程设计、参数反演等复杂优化问题。此外,文档还展示了该方法在SCI一区论文中的复现应用,体现了其科学性与实用性。; 适合人群:具备一定Matlab编程基础,熟悉优化算法和数值建模的研究生、科研人员及工程技术人员,尤其适合从事仿真优化、实验设计、代理模型研究的相关领域工作者。; 使用场景及目标:①解决高计算成本的多目标优化问题,通过代理模型降低仿真次数;②在无法解析求导或函数高度非线性的情况下寻找最优变量组合;③复现SCI高水平论文中的优化方法,提升科研可信度与效率;④应用于工程设计、能源系统调度、智能制造等需参数优化的实际场景。; 阅读建议:建议读者结合提供的Matlab代码逐段理解算法实现过程,重点关注克里金模型的构建步骤与NSGA-II的集成方式,建议自行调整测试函数或实际案例验证算法性能,并配合YALMIP等工具包扩展优化求解能力。
###################################################################################### ### Author/Developer: Nicolas CHEN ### Filename: export.py ### Version: 1.0 ### Field of research: Deep Learning in medical imaging ### Purpose: This Python script creates the CSV file from XML files. ### Output: This Python script creates the file "test.csv" ### with all data needed: filename, class_name, x1,y1,x2,y2 ###################################################################################### ### HISTORY ### Version | Date | Author | Evolution ### 1.0 | 17/11/2018 | Nicolas CHEN | Initial version ###################################################################################### import os, sys, random import xml.etree.ElementTree as ET from glob import glob import pandas as pd from shutil import copyfile annotations = glob('BCCD/Annotations/*.xml') df = [] cnt = 0 for file in annotations: #filename = file.split('/')[-1].split('.')[0] + '.jpg' #filename = str(cnt) + '.jpg' filename = file.split('\\')[-1] filename =filename.split('.')[0] + '.jpg' row = [] parsedXML = ET.parse(file) for node in parsedXML.getroot().iter('object'): blood_cells = node.find('name').text xmin = int(node.find('bndbox/xmin').text) xmax = int(node.find('bndbox/xmax').text) ymin = int(node.find('bndbox/ymin').text) ymax = int(node.find('bndbox/ymax').text) row = [filename, blood_cells, xmin, xmax, ymin, ymax] df.append(row) cnt += 1 data = pd.DataFrame(df, columns=['filename', 'cell_type', 'xmin', 'xmax', 'ymin', 'ymax']) data[['filename', 'cell_type', 'xmin', 'xmax', 'ymin', 'ymax']].to_csv('test.csv', index=False)
09-25
### 脚本原理分析 从 XML 文件创建包含文件名、类别名、坐标信息的 CSV 文件,其基本原理是通过解析 XML 文件,提取所需的信息(文件名、类别名、坐标信息),然后将这些信息存储到 CSV 文件中。 以下是一个简单的示例代码,展示了如何实现这个功能: ```python import xml.etree.ElementTree as ET import csv def xml_to_csv(xml_file, csv_file): tree = ET.parse(xml_file) root = tree.getroot() with open(csv_file, 'w', newline='') as csvfile: fieldnames = ['filename', 'class_name', 'xmin', 'ymin', 'xmax', 'ymax'] writer = csv.DictWriter(csvfile, fieldnames=fieldnames) writer.writeheader() filename = root.find('filename').text for obj in root.findall('object'): class_name = obj.find('name').text bbox = obj.find('bndbox') xmin = bbox.find('xmin').text ymin = bbox.find('ymin').text xmax = bbox.find('xmax').text ymax = bbox.find('ymax').text writer.writerow({ 'filename': filename, 'class_name': class_name, 'xmin': xmin, 'ymin': ymin, 'xmax': xmax, 'ymax': ymax }) ``` ### 脚本优化 1. **错误处理**:在解析 XML 文件时,添加错误处理机制,以防止因 XML 文件格式错误而导致脚本崩溃。 ```python try: tree = ET.parse(xml_file) root = tree.getroot() except ET.ParseError as e: print(f"Error parsing XML file {xml_file}: {e}") return ``` 2. **批量处理**:如果有多个 XML 文件需要处理,可以编写一个循环来批量处理这些文件。 ```python import os xml_dir = 'xml_files' csv_file = 'output.csv' with open(csv_file, 'w', newline='') as csvfile: fieldnames = ['filename', 'class_name', 'xmin', 'ymin', 'xmax', 'ymax'] writer = csv.DictWriter(csvfile, fieldnames=fieldnames) writer.writeheader() for xml_file in os.listdir(xml_dir): if xml_file.endswith('.xml'): xml_path = os.path.join(xml_dir, xml_file) try: tree = ET.parse(xml_path) root = tree.getroot() filename = root.find('filename').text for obj in root.findall('object'): class_name = obj.find('name').text bbox = obj.find('bndbox') xmin = bbox.find('xmin').text ymin = bbox.find('ymin').text xmax = bbox.find('xmax').text ymax = bbox.find('ymax').text writer.writerow({ 'filename': filename, 'class_name': class_name, 'xmin': xmin, 'ymin': ymin, 'xmax': xmax, 'ymax': ymax }) except ET.ParseError as e: print(f"Error parsing XML file {xml_path}: {e}") ``` ### 适配数据集 如果要将脚本适配到自己的数据集,需要注意以下几点: 1. **XML 文件结构**:确保 XML 文件的结构与脚本中解析的结构一致。如果 XML 文件的标签名称或层次结构不同,需要相应地修改脚本中的解析代码。 2. **坐标信息**:如果坐标信息的表示方式不同(例如,使用中心点坐标和宽高表示),需要修改提取坐标信息的代码。 ### 解决运行问题 1. **文件路径问题**:确保 XML 文件和 CSV 文件的路径正确。如果文件路径包含中文或特殊字符,可能会导致文件读取或写入失败。 2. **编码问题**:如果 XML 文件或 CSV 文件包含非 ASCII 字符,可能需要指定文件的编码方式。例如,在打开文件时添加 `encoding='utf-8'` 参数。 ```python with open(xml_file, 'r', encoding='utf-8') as f: tree = ET.parse(f) ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值