小编Ami*_*shi的帖子

NHibernate可以使用2种不同的模式吗?

NHibernate可以使用2种不同的模式吗?我有一个项目可以使用Schema A来处理几个部分而Schema可以B用于其他部分.这可能与NHibernate一起使用吗?我怎样才能做到这一点?

nhibernate

3
推荐指数
1
解决办法
824
查看次数

如何为DICOM文件生成SOPInstance UID?

我正在开发一个能够为PACS创建结构化报告的系统.

显然,为了创建一个DICOM实例(包含Report数据的文件),我需要三个UID用于Study,Series和Instance.StudyUID和SeriesUID必须与为其创建的研究和系列相同.但对于SOPInstanceUID,我需要生成新的UID.

getNewSOPInstanceUID在Pixelmed文档中看过方法,但我不熟悉Pixelmed源代码.我需要一个算法或Python源.

python uuid uniqueidentifier dicom

3
推荐指数
3
解决办法
7009
查看次数

SQL Server 仅读取有效 JSON 中的第一行

我的 JSON 如下所示。ADF 可以毫无问题地读取此 JSON 并导入所有行。

{"Row":{"Col1":"Val1", "Col2":"Val2"}}
{"Row":{"Col1":"Val1", "Col2":"Val2"}}
{"Row":{"Col1":"Val1", "Col2":"Val2"}}
Run Code Online (Sandbox Code Playgroud)

但是,当我使用下面的查询从 SQL 读取此内容时,它仅返回第一条记录。

SELECT * FROM OPENJSON(@JSONDATA, '$')
with (
    Col1 varchar(25) '$.Row.Col1'
);
Run Code Online (Sandbox Code Playgroud)

你知道为什么吗?

json sql-server-2016 azure-sql-database

3
推荐指数
1
解决办法
4545
查看次数

如何解决找不到能够从 TupleBackedMap 类型转换为 [com.example.dto.ExampleDto] 类型的转换器

org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [org.springframework.data.jpa.repository.query.AbstractJpaQuery$TupleConverter$TupleBackedMap] to type [com.example.dto.ExampleDto]
at org.springframework.core.convert.support.GenericConversionService.handleConverterNotFound(GenericConversionService.java:321) ~[spring-core-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:194) ~[spring-core-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:174) ~[spring-core-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.data.repository.query.ResultProcessor$ProjectingConverter.convert(ResultProcessor.java:293) ~[spring-data-commons-2.1.5.RELEASE.jar:2.1.5.RELEASE]
Run Code Online (Sandbox Code Playgroud)

当我在使用本机 JPA 查询中返回 2 个值的查询时,会抛出上述错误。我在下面的 DTO 中捕获查询响应:

@Data
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class ExampleDto {
    @Id
    private String name1;
    private int nameFlag;
}
Run Code Online (Sandbox Code Playgroud)

在 DAO 类中,我调用本机查询如下。该查询在 SQL Developer 中工作并返回 2 条记录。但是当如下调用时,它会抛出上述错误。

List<ExampleDto> getExampleDto = myJPARepository.
                .findNameObject(uuid);
Run Code Online (Sandbox Code Playgroud)

DTO 类中有问题,我需要更改。注释?我不确定这里缺少什么,并尽我所能尝试,放入 @Entity 注释,@Data 注释,在调用查询时我无法解决此错误。

更新:与此相关的本机查询是

@Query(value = "select name1, nameFlag from NameTable",
          nativeQuery = true, name = …
Run Code Online (Sandbox Code Playgroud)

jpa nativequery spring-data-jpa spring-boot

3
推荐指数
1
解决办法
7831
查看次数

如何计算体素大小?

提供来自 DICOM 标头的以下信息,如何计算体素大小的第三个值?我假设前两个值是 0.515625 和 0.515625。

BitsAllocated: "16"
BitsStored: "12"
Columns: 512
HighBit: "11"
ImageOrientation: "1\0\0\0\-1\0"
ImagePosition: "-144\-34.7242241\925.599976"
ImageType: "ORIGINAL\PRIMARY\AXIAL\HELIX"
InstanceNumber: "456"
Modality: "CT"
PhotometricInterpretation: "MONOCHROME2"
PixelRepresentation: "0"
PixelSpacing: "0.515625\0.515625"
RescaleIntercept: "1"
Rows: 512
SamplesPerPixel: "1"
SeriesDescription: "CERVEAU SANS IV"
SeriesNumber: "3"
SliceThickness: "1.50"
WindowCenter: "00040\00040"
WindowWidth: "00120\00120"
imagesFormat: "jpg"
modality: "CT"
name: "soft tissue"
nodeId: "557621"
pixelHeight: "0.515625"
pixelWidth: "0.515625"
Run Code Online (Sandbox Code Playgroud)

注意:我收到的是 JPEG 图像堆栈,而不是 DICOM,并且它带有一个包含我在上面发布的值的文件。如果需要,我可以返回并询问文件中的其他信息。

medical dicom medical-imaging

3
推荐指数
1
解决办法
866
查看次数

如何使用扩展来扩展 FHIR 中的原始数据类型?

我正在尝试整合FHIR KBV_PR_Base_Observation_Heart_Rate个人资料。在FHIR资源的编码段中,配置文件规定显示段应提供德语区的扩展。

https://fhir.kbv.de/StructureDefinition/KBV_PR_Base_Observation_Heart_Rate

我怎样才能满足个人资料的要求?我不明白我现在应该如何包含扩展名?

我尝试了以下操作,但验证器似乎不喜欢它(这也是合乎逻辑的,因为不再有原始数据类型):

    code: {
        coding: [{
            system: 'http://loinc.org',
            version: '2.69',
            code: '8867-4',
            display: {
                value: 'Heart rate',
                extension: {
                    url: 'https://fhir.kbv.de/StructureDefinition/KBV_EX_Base_Terminology_German',
                    anzeigenameCodeLoinc: {
                        extension: {
                            content: {
                                url: 'content',
                                valueString: 'Herzfrequenz',
                            },
                        },
                    },
                },
            },
        }, {
            system: 'http://snomed.info/sct',
            version: '1.1.3',
            code: '364075005',
            display: {
                value: 'Heart rate (observable entity)',
                extension: {
                    url: 'https://fhir.kbv.de/StructureDefinition/KBV_EX_Base_Terminology_German',
                    anzeigenameCodeLoinc: {
                        extension: {
                            content: {
                                url: 'content',
                                valueString: 'Herzfrequenz',
                            },
                        },
                    },
                },
            },
        }],
        text: 'Heart rate',
   }, …
Run Code Online (Sandbox Code Playgroud)

hl7 hl7-fhir

3
推荐指数
1
解决办法
747
查看次数

Dapper.Contrib:如何通过过滤 ID 以外的列来获取行?

我的班级如下:

[Table("tblUser")]
public class User
{
    [Key]
    public int Id { get; set; }
    public string Title { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

使用Dapper.Contrib,有没有办法通过而不是Id来获取User记录?Title

如果我像下面这样查询,它就有效。但是,我想过滤Title不是键的列。

await connection.GetAsync<User>(Id);
Run Code Online (Sandbox Code Playgroud)

dapper dapper-contrib

2
推荐指数
1
解决办法
4394
查看次数

如何注册私有 DICOM 标签?

我想知道公司(比如飞利浦或西门子)如何注册私有 DICOM 标签?

我的意思是:

  1. 如何保证DICOM组不被其他厂商拿走?假设飞利浦选择了标签 (1111, 00xx),所以它需要知道“1111”组没有被占用。
  2. 之后,是否需要涉及 NEMA?或者任何其他管理这些私人标签的组织?

dicom

2
推荐指数
1
解决办法
563
查看次数

如何修复 pydicom 的 dcmread() 前导错误?

dcmread()在处理给定路径中确实存在的 DICOM 文件时遇到问题。我不确定出了什么问题。这是我的代码:

import pydicom

f = "/exact/path/hi.dcm"
fn = get_testdata_file(f)
ds = pydicom.dcmread(fn)

ds.SOPClassUID = ds.MediaStorageSOPClassUID
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

Traceback (most recent call last):
  File "addfields.py", line 14, in <module>
    ds = pydicom.dcmread(fn)
  File "/Users/user/opt/anaconda3/lib/python3.7/site-packages/pydicom/filereader.py", line 871, in dcmread
    force=force, specific_tags=specific_tags)
  File "/Users/user/opt/anaconda3/lib/python3.7/site-packages/pydicom/filereader.py", line 668, in read_partial
    preamble = read_preamble(fileobj, force)
  File "/Users/user/opt/anaconda3/lib/python3.7/site-packages/pydicom/filereader.py", line 605, in read_preamble
    preamble = fp.read(128)
AttributeError: 'NoneType' object has no attribute 'read'
Run Code Online (Sandbox Code Playgroud)

But I am not sure why, because "hi.dcm" is a file that …

dicom python-3.x pydicom

2
推荐指数
1
解决办法
1520
查看次数

使用 dicom2nifti 转换无法正常工作

我有一系列(.dcm)要转换为nii.gz文件的每位患者的 dicom 文件,但以下转换没有任何反应(甚至是错误信息)...

import dicom2nifti
dicom2nifti.settings.set_gdcmconv_path('C:/Program Files/GDCM 3.0/bin/gdcmconv.exe')
dicom2nifti.convert_directory('M0_1', 'M0_1.nii.gz')
Run Code Online (Sandbox Code Playgroud)

尝试其他方法时出现错误......

import dicom2nifti
dicom2nifti.settings.set_gdcmconv_path('C:/Program Files/GDCM 3.0/bin/gdcmconv.exe')
dicom2nifti.dicom_series_to_nifti('M0_1', 'M0_1.nii.gz')
Run Code Online (Sandbox Code Playgroud)

错误日志:

Traceback (most recent call last):
  File ".\test.py", line 5, in <module>
    dicom2nifti.dicom_series_to_nifti('M0_1', 'M0_1.nii.gz')
  File "D:\Anaconda3\envs\pydicom\lib\site-packages\dicom2nifti\convert_dicom.py", line 78, in dicom_series_to_nifti
    return dicom_array_to_nifti(dicom_input, output_file, reorient_nifti)
  File "D:\Anaconda3\envs\pydicom\lib\site-packages\dicom2nifti\convert_dicom.py", line 112, in dicom_array_to_nifti
    if not are_imaging_dicoms(dicom_list):
  File "D:\Anaconda3\envs\pydicom\lib\site-packages\dicom2nifti\convert_dicom.py", line 151, in are_imaging_dicoms
    if common.is_philips(dicom_input):
  File "D:\Anaconda3\envs\pydicom\lib\site-packages\dicom2nifti\common.py", line 102, in is_philips
    header = dicom_input[0]
IndexError: list index out of range
Run Code Online (Sandbox Code Playgroud)

文件结构:

M0_1 …
Run Code Online (Sandbox Code Playgroud)

python image-conversion nifti pydicom medical-imaging

2
推荐指数
1
解决办法
2761
查看次数