当前位置:网站首页>Utilisation de simpletk - 4. Question étrange
Utilisation de simpletk - 4. Question étrange
2022-07-02 22:33:00 【Tonnes sans combat】
Catalogue des articles
1. DonnéesdtypeQuestions de type
1.1 Déterminer la cause
Description du phénomène
- windowsUtilisation suivantenumpyTraitementNiftiImage et enregistrement,
- L'image qui en résulte est49KB
- ITK-SnapOn peut l'ouvrir.
- linuxUtilisez le même code ci - dessous pournumpyTraitementNiftiImage et enregistrement
- Quand j'ai l'image85KB
- ITK-SnapErreur ouverte:
itk::ERROR: NiftiImageIO(000001CB27E1CD80): Unknown component type: 0
- Mais3D SlicerOn peut l'ouvrir.
Trouver la raison
- Comme le Code est le même,Testé sauvegardénumpyLes mêmes données,Mais la taille finale du fichier est différente.
- Considérez donc le type de données,dtypeLa question de
L'expérience
Parce qu'il y a une phrase dans le Code qui est:
skull_striper_array = np.where(pred_label_array - skull_mask_array == 1, 1, 0)
Voir les types de données un par un ,Découverte
pred_label_array.dtype
> dtype('uint8')
skull_mask_array.dtype
> dtype('uint8')
skull_striper_array.dtype
> dtype('int64')
Il est donc tenu compte de ce qui suit: numpy Constante introduite dans , Provoque un changement de type de données .
skull_mask_path = "./skull_striper_mask.nii.gz"
skull_mask_image = sitk.ReadImage(skull_mask_path)
print(skull_mask_image.GetPixelIDTypeAsString())
> 64-bit signed integer
Voirlinux Type de données pour l'image suivante ,En effet.int64,Passer àint32Après,itk-snap Vous pouvez ouvrir l'image traitée .
Tenir compte des différents environnements numpy Type de données par défaut pour les constantes
- linuxEnvironnement:numpy-1.19.2、simpleitk-2.1.1.2
test =np.array([1]) test.dtype > dtype('int64') - windowsEnvironnement:numpy-1.19.2、simpleitk-2.1.1.2
test =np.array([1]) test.dtype > dtype('int32')
1.2 numpyPar défautdtypeType
InnumpyDocumentation-Data typesMoyenne,Il y a la description suivante:
NumPyOffrenumpy.iinfoEtnumpy.finfoPour confirmerNumpy Valeurs maximales des entiers et des points flottants .
np.iinfo(int) # Bounds of the default integer on this system.
iinfo(min=-9223372036854775808, max=9223372036854775807, dtype=int64)
np.iinfo(np.int32) # Bounds of a 32-bit integer
iinfo(min=-2147483648, max=2147483647, dtype=int32)
np.iinfo(np.int64) # Bounds of a 64-bit integer
iinfo(min=-9223372036854775808, max=9223372036854775807, dtype=int64)
Donc testez sur votre propre machine :
- windowsAllez.:

- linuxAllez.:

- Pour que vous sachiez, Quand j'utilise le code suivant , Après l'introduction d'un entier
skull_striper_array = np.where(pred_label_array - skull_mask_array == 1, 1, 0) - windows Par défaut, cet entier (int)- Oui.int32Bits,Etlinux Par défaut, cet entier (int)- Oui.int64Bits
StackOverflow Il y a un problème similaire. ,Voir détailsSpecifying default dtype for np.array(1.)
1.3 itk-snapOuvre.int64Problèmes de formatage
Le phénomène est décrit ci - dessus. :
- 64 Utilisation d'images bitwise ITK-SnapErreur ouverte:
itk::ERROR: NiftiImageIO(000001CB27E1CD80): Unknown component type: 0
- Mais3D SlicerOn peut l'ouvrir.
Donc, considérez si ITK-SnapNon pris en chargeint64Image en bits. Aucun contenu pertinent valide n'a été trouvé pour le moment .
TBD
边栏推荐
- About test cases
- A specially designed loss is used to deal with data sets with unbalanced categories
- Learn computer knowledge from scratch
- 关于PHP-数据库的 数据读取,Trying to get property 'num_rows' of non-object?
- Interpretation of CVPR paper | generation of high fidelity fashion models with weak supervision
- ArrayList analysis 2: pits in ITR, listiterator, and sublist
- UE4 游戏架构 学习笔记
- : last child does not take effect
- [shutter] shutter opens a third-party application (url|launcher plug-in search and installation | url| launcher plug-in official example | open browser | open a third-party application)
- 分享一下如何制作专业的手绘电子地图
猜你喜欢

How do I access the kubernetes API?

Error in PIP installation WHL file: error: is not a supported wheel on this platform

Interpretation of CVPR paper | generation of high fidelity fashion models with weak supervision

《Just because》阅读感受

New feature of go1.18: introduce new netip Network Library

Image segmentation using pixellib

Based on asp Net (used mobile phone sales management system) +asp Net+c # language +vs2010+ database can be used for course design and post design learning

C language, to achieve three chess games

【ODX Studio编辑PDX】-0.1-如何快速查看各Variant变体间的支持的诊断信息差异(服务,Sub-Function...)

What is it that makes you tremble? Those without fans can learn
随机推荐
20220702-程序员如何构建知识体系?
LandingSite eBand B1冒烟测试用例
What "real skills" should a million year old cloud native developer master? Alibaba, Tencent, meituan and byte decrypt together
Meibeer company is called "Manhattan Project", and its product name is related to the atomic bomb, which has caused dissatisfaction among Japanese netizens
Secondary development of ANSYS APDL: post processing uses command flow to analyze the result file
Leetcode theme [array] -169- most elements
20220702 how do programmers build knowledge systems?
Reading experience of just because
sql service 截取字符串
PHP微信抢红包的算法
Daily book -- analyze the pain points of software automation from simple to deep
Micro service gateway selection, please accept my knees!
[leetcode] sword finger offer 11 Rotate the minimum number of the array
: last child does not take effect
【ODX Studio编辑PDX】-0.1-如何快速查看各Variant变体间的支持的诊断信息差异(服务,Sub-Function...)
Ransack combined condition search implementation
Interpretation of CVPR paper | generation of high fidelity fashion models with weak supervision
Sql service intercepts string
New feature of go1.18: trylock, which has been tossed n times
服务可见可观测性