第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

用于圖像配準(zhǔn)的 SimpleITK。寫(xiě)作問(wèn)題

用于圖像配準(zhǔn)的 SimpleITK。寫(xiě)作問(wèn)題

犯罪嫌疑人X 2022-12-20 09:46:52
我已經(jīng)從源代碼安裝了 Python3 上的 SimpleITK 包。當(dāng)我執(zhí)行提供的注冊(cè)示例時(shí):#!/usr/bin/env python    #=========================================================================##  Copyright NumFOCUS##  Licensed under the Apache License, Version 2.0 (the "License");#  you may not use this file except in compliance with the License.#  You may obtain a copy of the License at##         http://www.apache.org/licenses/LICENSE-2.0.txt##  Unless required by applicable law or agreed to in writing, software#  distributed under the License is distributed on an "AS IS" BASIS,#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.#  See the License for the specific language governing permissions and#  limitations under the License.##=========================================================================from __future__ import print_functionimport SimpleITK as sitkimport sysimport osdef command_iteration(method) :    print("{0:3} = {1:10.5f} : {2}".format(method.GetOptimizerIteration(),                               method.GetMetricValue(),                               method.GetOptimizerPosition()))if len ( sys.argv ) < 4:    print( "Usage: {0} <fixedImageFilter> <movingImageFile>                 <outputTransformFile>".format(sys.argv[0]))    sys.exit ( 1 )fixed = sitk.ReadImage(sys.argv[1], sitk.sitkFloat32)moving = sitk.ReadImage(sys.argv[2], sitk.sitkFloat32)R = sitk.ImageRegistrationMethod()R.SetMetricAsMeanSquares()R.SetOptimizerAsRegularStepGradientDescent(4.0, .01, 200 )R.SetInitialTransform(sitk.TranslationTransform(fixed.GetDimension()))R.SetInterpolator(sitk.sitkLinear)R.AddCommand( sitk.sitkIterationEvent, lambda: command_iteration(R) )在寫(xiě)入圖像并觸發(fā)以下錯(cuò)誤之前,執(zhí)行Python ImageRegistrationMethod1.py image_ref.tif image_moving.tif res.tif似乎運(yùn)行良好:res.tif
查看完整描述

2 回答

?
慕尼黑的夜晚無(wú)繁華

TA貢獻(xiàn)1864條經(jīng)驗(yàn) 獲得超6個(gè)贊

運(yùn)行 ImageRegistrationMethod1 示例的結(jié)果是一個(gè)轉(zhuǎn)換。SimpleITK 支持多種文件格式進(jìn)行轉(zhuǎn)換,包括文本文件 (.txt)、Matlab 文件 (.mat) 和 HDF5Tranform (.hdf5)。這不包括 .tif 文件,這是一個(gè)圖像文件,而不是轉(zhuǎn)換。

您可以在 SimpleITK IO 頁(yè)面的轉(zhuǎn)換部分閱讀更多相關(guān)信息:

https://simpleitk.readthedocs.io/en/master/IO.html#transformations

在這個(gè)例子中,產(chǎn)生的變換是一個(gè) 3-d 平移。因此,如果您選擇了 .txt 文件輸出,您可以在參數(shù)行中看到 X、Y 和 Z 翻譯。


查看完整回答
反對(duì) 回復(fù) 2022-12-20
?
偶然的你

TA貢獻(xiàn)1841條經(jīng)驗(yàn) 獲得超3個(gè)贊

如果你想寫(xiě) dicom 作為文件輸出,請(qǐng)?jiān)囋囘@個(gè)。

writer.SetFileName(os.path.join('transformed.dcm'))
writer.Execute(cimg)


查看完整回答
反對(duì) 回復(fù) 2022-12-20
  • 2 回答
  • 0 關(guān)注
  • 185 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)