原创 三維醫療影像打開和保存.vtk文件的python代碼

(更多數學原理小文請關注公衆號:未名方略) 首先安裝vtk (Visualization Toolkit),有很多種方法,這裏用了conda conda install -c anaconda vtk 以下是效果截圖,原效果是可以鼠標拖

原创 vscode選擇已有環境

首先終端打開vscode code . ctrl + alt +p Python:選擇解析器 如果碰上cannot connect to X server opencv python xhost +$HOSTNAME export

原创 tensorflow的axis——軸研科技

目錄 tf.argmax() tf.reduce_mean() tf.argmax(), 自帶降低一維 import tensorflow as tf import numpy as np x = np.ones((2,3,3,1))

原创 python圖像大小縮放使用cv2.resize()或scipy.ndimage.zoom()

import cv2 tile = cv2.resize(tile,(int(Ximageorg/256),int(Yimageorg/256)),interpolation=cv2.INTER_CUBIC) import sc

原创 np.where()巨型指導

涉及bool運算其實有點繞,官網太簡潔,不好懂。 Return elements, either from x or y, depending on condition. If only condition is given, retur

原创 Eight queens經典回溯算法

def conflict(state, nextX): print('state:',state) nextY = len(state) for i in range(nextY): print

原创 np.unique()例子

Find the unique elements of an array. Returns the sorted unique elements of an array. There are two optional outputs in

原创 算法工程師的數學小屋—公衆號

數學和代碼是算法工程師的左拳右拳。歡迎關注微信訂閱號:Deeper_Stratagem 這裏有數學主題的探討,也有碼行天下的吟詠、手不釋卷的相惜。

原创 python輸出txt追加和重寫模式

file = open(PATH+"write_test.txt", encoding="utf-8",mode="w") file.write("君臣佐使") file.write('\r\n') file.close()

原创 linux訪問雲服務器工具和命令

SSH 爲 Secure Shell 的縮寫,由 IETF 的網絡小組(Network Working Group)所制定;SSH 爲建立在應用層基礎上的安全協議。SSH 是目前較可靠,專爲遠程登錄會話和其他網絡服務提供安全性的協議。利用

原创 數組之間的與和或邏輯運算np.all() np.any()

Test whether any array element along a given axis evaluates to True. Returns single boolean unless axis is not None im

原创 現代機械設計類SCI雜誌

1、Journal of Mechanical Design 美國 中科院三區 網址:http://mechanicaldesign.asmedigitalcollection.asme.org/journal.aspx   2、Adva

原创 ~取反運算例子

原碼,反碼,補碼。爲什麼需要三種碼?計算機實際存儲的都是補碼。 因爲符號位!所以做加法直接用補碼相加,正數的反碼和補碼就是原碼本身。負數的反碼即字面意思,符號位不變,其他各位取反。負數的補碼是反碼+1。 還原:負數的反碼還原爲原碼很簡單,

原创 醫療圖像csv文件處理代碼python

利用pandas