3D reconstruction from OCT scans

Get the surface point cloud image from OCT structure data.

A. MIP B.  assign the alpha channel

Align all images through Mesh lab, ref, save the piont cloudhttps://www.youtube.com/watch?v=4g9Hap4rX0k&t=601sMesh

Mesh Layer Flatten visible layers

    1. Set the normal surface of the point cloud
    Normals, – compute normals for point sets
    1. get the mesh from the pointcloud
    Resmeshing, – Screened Poisson surface reconstruction

 

Anaconda install error on windows

Windows error: Failed to create Anaconda menus or Failed to add Anaconda to the system PATH

During installation on a Windows system, a dialog box appears that says “Failed to create Anaconda menus, Abort Retry Ignore” or “Failed to add Anaconda to the system PATH.” There are many possible Windows causes for this.

Solution

Try these solutions, in order:

  • Do not install on a PATH longer than 1024 characters
  • Turn off anti-virus programs during install, then turn back on
  • Uninstall all previous Python installations
  • Clear all PATHs related to Python in sysdm.cpl file
  • Delete any previously set up Java PATHs
  • If JDK is installed, uninstall it.

Ref:

https://github.com/ContinuumIO/anaconda-issues/issues/732

https://docs.anaconda.com/anaconda/user-guide/troubleshooting#windows-error-failed-to-create-anaconda-menus-or-failed-to-add-anaconda-to-the-system-path

 

Install cuda on windows

  1. Install Visual studio
  2. Follow the instruction https://developer.nvidia.com/how-to-cuda-c-cpp
  3. Enable the MS .NET Framework 3.5 https://stackoverflow.com/questions/39800823/cannot-compile-cuda-code-in-vs-2015/39862254#39862254

For the error: gdi32.lib missing   https://developercommunity.visualstudio.com/content/problem/41860/gdi32lib-missing.html

REF:

CUDA tookit document:

http://docs.nvidia.com/cuda/index.html

UDACITY course:

https://www.udacity.com/course/intro-to-parallel-programming–cs344

 

For the project:

Cannot find corecrt.h: $(UniversalCRT_IncludePath) is wrong

 

Get 3D mesh (stl) file from dicom file

1.load the dicom file to 3D slicer. (Patient name, patient ID, and series instance UID fields should not be empty or missing)

A spacing of 0 is not allowed: Spacing is [0, 0, 1]
Algorithm vtkITKArchetypeImageSeriesScalarReader(0xe3186a0) returned failure for request: vtkInformation (0xe31ace0)
Debug: Off
Modified Time: 11857358
Reference Count: 1
Registered Events: (none)
Request: REQUEST_INFORMATION
ALGORITHM_AFTER_FORWARD: 1
FORWARD_DIRECTION: 0

2. Convert the vtk file by 3D slicer.

https://www.embodi3d.com/blogs/entry/227-medical-3d-model-creation-from-ct-scan-to-3d-printable-stl-file-in-20-minutes-using-free-software-programs-3d-slicer-blender-and-meshmixer/

3.Edit and modify the stl file….

4. sent to the 3D printer

Colors in matplotlib

matplotlib colors

http://matplotlib.org/examples/color/named_colors.html

 

For xkcd colors

plt.plot([1,2], lw=4, c='xkcd:baby poop green')
xkcd colors

Ref

https://xkcd.com/color/rgb/

https://stackoverflow.com/questions/22408237/named-colors-in-matplotlib

Ubuntu loop login

check the authority of .Xauthority under home, if it is root

sudo chown abc:abc .Xauthority

And then follow these steps to reinstall the long lived branch version nvidia drivers 375

https://askubuntu.com/questions/223501/ubuntu-gets-stuck-in-a-login-loop?noredirect=1&lq=1

 

穷人深度学习攒机小记(2017.5)

老板给的预算$1200,使用场景:CNN,GAN,有时会重新训练整个model

硬件篇

基本攒机思路是大显存GPU,高频少核CPU(穷),尽可能多的PCI E 3.0 lanes为后续扩展提供便利,其余配件过得去的情况下能省则省。。。考虑性价比,这个价格基的GPU本上只能选1070了。

方案1: 低性能workstation

发现基本配不出来。。

方案2: 中等性能desktop

Intel i5 7600,gtx 1070, z270

方案3: 捡垃圾

捡个类似Dell T7600的垃圾, 双路xeon cpu获得大量pcie,gtx 1070,

http://www.ebay.com/usr/digitalmind2000?_trksid=p2047675.l2559

后来突然发现NVIDIA对学术界对支持还不错,有一个GPU grant项目,可提供包括Titan Xp内的GPU给researcher。于是满怀希望以老板的名义赶紧写了一份proposal交出去。N厂(爸爸!)动作很快,一周多的时间就出了结果,送了一块titan xp。

于是终于可以在有限的预算内组出一台能用的机子了,考虑到漫漫phd生涯平时机器基本上一直都开着,于是排除掉捡垃圾的方案,剩下以下两个:

1.  desktop

Intel i7-7700k, msi z270, 16G*2, 512g ssd

缺点:桌面级LGA1151 socket cpu支持的pcie lanes只有16,单卡就占了16条(据说8条其实也行),内存也只支持到64G,占4pcie的M.2 的ssd也用不了,未来的扩展空间很有限。

2. workstation

配置清单:

最后为了给第二块卡和大内存使用场景留出空间,还是用了2011-v3 workstation的方案。

选择思路:

GPU:Titan Xp(自己配的话1080ti,1070的性价比较高)

CPU:i7系列至少要到6850才有40pcie lanes,6850以上价格过高,相比之下xeon e5全系支持40 lanes。最后选了e5-1620 v4,4核主频3.5,10MB cache, newegg上卖还不到300,真是穷人的福音,虽然性能有点烂。。。

Motherboard:早期的x99主板可能不支持新一代cpu,需要升级bios。以及最好是有4pcie插槽,支持4 GPU,  比如GA-X99-UD4。然而我觉得未来撑死也就2卡的水平。

Hard disk:M.2 SSD是未来发展方向,比SATA的快太多。

Memory:16g*2 DDR4,随便买

Power supply: 纸面功率500w,未来再加一块titan 750w,配个1000w gold的差不多了。

Case:Mid tower,随便买。水冷,多风扇什么的,土豪请随意

CPU cooler:支持2011-v3,能制冷140w cpu就行,反正不放在我办公室,噪音什么的无所谓····

 

5.16 下单完成!5.17 titan x到了·······

 

软件篇 (to be continued)

系统:

Window 10 + ubuntu 16.04

Environments:

NVIDIA Drivers, CUDA library, cudnn, python, tensorflow

NVIDIA Drivers

https://askubuntu.com/questions/149206/how-to-install-nvidia-run

CUDA

https://askubuntu.com/questions/799184/how-can-i-install-cuda-on-ubuntu-16-04

`export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}`

`http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#runfile-installation`

cuDNN

https://askubuntu.com/questions/767269/how-can-i-install-cudnn-on-ubuntu-16-04

Anaconda

install pip

Tensorflow

https://www.tensorflow.org/install/install_linux#installing_with_anaconda

Troubleshoot

ImportError: libcublas.so.8.0: cannot open shared object file: No such file or directory

https://stackoverflow.com/questions/36159194/tensorflow-libcudart-so-7-5-cannot-open-shared-object-file-no-such-file-or-di

Add the path to global environment

https://serverfault.com/questions/201709/how-to-set-ld-library-path-in-ubuntu

/etc/environment

辅助工具

network disk

sudo apt install smbclient

sudo apt-get install cifs-utils

openSSH

Teamviewer