A: Build
1. download dcmtk-DCMTK-3.6.6 from github then unzip it.
2. cd dcmtk-DCMTK-3.6.6 && mkdir cmake-build && cd cmake-build
3.change cmake files to suppress some errors. 3.1 open <dcmtkpath>/CMake/dcmtkUseAndroidSDK.cmake 3.2 find the two functions, and return directly, we do not need them: add return() to the first line of DCMTK_ANDROID_START_EMULATOR and DCMTK_SETUP_ANDROID_EMULATOR? 3.3 comment the three lines in DCMTK_ANDROID_WAIT_FOR_EMULATOR #while(NOT EMULATOR_NAME) # ? ?DCMTK_ANDROID_GET_EMULATOR_NAME(EMULATOR_NAME "${EMULATOR_UUID}") #endwhile()
4. execute cmake, please change the paths to yours. cmake -DCMAKE_TOOLCHAIN_FILE=/Users/alex/Library/Android/sdk/ndk/22.0.7026061/build/cmake/android.toolchain.cmake -DANDROID_NDK=/Users/alex/Library/Android/sdk/ndk/22.0.7026061 -DCMAKE_BUILD_TYPE=Release -DANDROID_ABI="arm64-v8a" -DBUILD_SHARED_LIBS=ON ?-DANDROID_SDK_ROOT=/Users/alex/Library/Android/sdk ? -DANDROID_EMULATOR_AVD=/Users/alex/.android/avd/Pixel_2_API_26.avd -DEMULATOR_STATE=RUNNING -DEMULATOR_NAME=emulator-5554 ..
5. make -j8
B: running
pre-1. 有可能需要配置环境变量DCMDICTPATH: export set DCMDICTPATH=/Users/alex/Downloads/safari_download/dcmtk-DCMTK-3.6.6-osx/dcmdata/data/dicom.dic
1. 使用img2dcm生成dcm文件 img2dcm ?-vlp -k "PatientName=Miss 翠花" -k "PatientSex=M" ?-k "PatientAge=22" -k "StudyDate=20080808" -k "PatientID=1229009900" -k "Modality=ES" -k "SpecificCharacterSet=ISO_IR 192" -k "Manufacturer=Insighters" insighters01.jpg insighters01.dcm
2. 使用dcmdjpeg将jpeg转换成lossless dcmdjpeg xxx_501.dcm ixxx_501.dcm
3. 使用storescu(或者dcmsend)将dcm文件上传到dicoogle(或者storescp) storescu -v +v -aec DICOOGLE-STORAGE 127.0.0.1 6666 xxx_501.dcm dcmsend -v +v -aec DICOOGLE-STORAGE 127.0.0.1 6666 xxx_5011.dcm
PS: 1. 可以运行storescp替换dicoogle测试:storescp 8888 -v +v -aet DICOOGLE-STORAGE (假装自己是dicoogle) 2. 可以使用dcm4che的命令行代替dcmtk 比如:storescu /Users/alex/work/sts-workspace/dcm4che-master/dcm4che-assembly/target/dcm4che-5.24.0-bin/dcm4che-5.24.0/bin/storescu -c DICOOGLE-STORAGE@localhost:6666 /Users/alex/work/sts-workspace/dicoogle/dicoogle_bin/test_dir/xxx_001.dcm 或者:jpg2dcm /Users/alex/work/sts-workspace/dcm4che-master/dcm4che-assembly/target/dcm4che-5.24.0-bin/dcm4che-5.24.0/bin/jpg2dcm -m "PatientName=Miss 翠花" -m "PatientSex=M" ?-m "PatientAge=22" -m "StudyDate=20080808" -m "PatientID=1229009900" -m "Modality=ES" -m "SpecificCharacterSet=ISO_IR 192" -m "Manufacturer=BF" xxx.jpg xxx_501.dcm ?
|