当前位置:网站首页>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.iinfo
Etnumpy.finfo
Pour 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
边栏推荐
- Perceptron model and Application
- Infrastructure is code: a change is coming
- From "bronze" to "King", there are three secrets of enterprise digitalization
- Introduction to the principle of geographical detector
- Daily book -- analyze the pain points of software automation from simple to deep
- PHP wechat red packet grabbing algorithm
- 一周生活
- Record the functions of sharing web pages on wechat, QQ and Weibo
- LandingSite eBand B1冒烟测试用例
- 《乔布斯传》英文原著重点词汇笔记(十)【 chapter eight】
猜你喜欢
An overview of the development of affective computing and understanding research
New feature of go1.18: introduce new netip Network Library
Phpcms realizes the direct Alipay payment function of orders
sql service 截取字符串
建立自己的网站(22)
Perceptron model and Application
Lightgbm principle and its application in astronomical data
From "bronze" to "King", there are three secrets of enterprise digitalization
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
Daily book -- analyze the pain points of software automation from simple to deep
随机推荐
Evolution of messaging and streaming systems under the native tide of open source cloud
Micro service gateway selection, please accept my knees!
使用 EMQX Cloud 实现物联网设备一机一密验证
Unity3D学习笔记4——创建Mesh高级接口
Lightgbm principle and its application in astronomical data
Perceptron model and Application
[shutter] shutter custom fonts (download TTF fonts | pubspec.yaml configure font resources | synchronize resources | globally apply fonts | locally apply fonts)
Ransack组合条件搜索实现
记录一下微信、QQ、微博分享web网页功能
[001] [arm-cortex-m3/4] internal register
Market Research - current situation and future development trend of carob chocolate market
Regular expression (2)
Socket套接字C/S端流程
The difference between include < > and include ""
How to center the positioned text horizontally and vertically
技术人创业:失败不是成功,但反思是
[shutter] shutter application life cycle (foreground state resumed | background state paused | inactive | component separation state detached)
Meibeer company is called "Manhattan Project", and its product name is related to the atomic bomb, which has caused dissatisfaction among Japanese netizens
Unity3d learning notes 4 - create mesh advanced interface
SQL必需掌握的100个重要知识点:管理事务处理