|
71 | 71 | "metadata": {}, |
72 | 72 | "outputs": [], |
73 | 73 | "source": [ |
74 | | - "from TPTBox.core.bids_files import formats,entities_keys\n", |
| 74 | + "from TPTBox.core.bids_files import entities_keys, formats\n", |
| 75 | + "\n", |
75 | 76 | "print('Known formats:\\n','\\n'.join(formats))\n", |
76 | 77 | "print()\n", |
77 | 78 | "print()\n", |
|
104 | 105 | "outputs": [], |
105 | 106 | "source": [ |
106 | 107 | "from pathlib import Path\n", |
| 108 | + "\n", |
107 | 109 | "from TPTBox.core.dicom.dicom_extract import extract_dicom_folder\n", |
108 | 110 | "\n", |
109 | 111 | "path_to_dicom_dataset = \"TODO\"\n", |
|
123 | 125 | "outputs": [], |
124 | 126 | "source": [ |
125 | 127 | "from pathlib import Path\n", |
| 128 | + "\n", |
126 | 129 | "path_to_dicom_dataset = \"/media/data/robert/datasets/dicom_example/VR-DICOM/\"\n", |
127 | 130 | "dataset_name = 'VR-DICOM2'\n", |
128 | 131 | "target_folder = Path(path_to_dicom_dataset).parent\n", |
|
142 | 145 | "metadata": {}, |
143 | 146 | "outputs": [], |
144 | 147 | "source": [ |
145 | | - "from TPTBox import BIDS_Global_info,BIDS_FILE\n", |
| 148 | + "from TPTBox import BIDS_FILE, BIDS_Global_info\n", |
146 | 149 | "from TPTBox.core.bids_constants import sequence_splitting_keys\n", |
| 150 | + "\n", |
147 | 151 | "print(\"if one of the values of these keys is diffrent, than it is considered a other sequence:\", sequence_splitting_keys)\n", |
148 | 152 | "print(\"sub will alway split\")\n", |
149 | 153 | "\n", |
|
215 | 219 | "metadata": {}, |
216 | 220 | "outputs": [], |
217 | 221 | "source": [ |
218 | | - "from TPTBox.stitching import stitching\n", |
219 | | - "from TPTBox import to_nii\n", |
220 | 222 | "from concurrent.futures import ProcessPoolExecutor\n", |
221 | 223 | "\n", |
| 224 | + "from TPTBox import to_nii\n", |
| 225 | + "from TPTBox.stitching import stitching\n", |
| 226 | + "\n", |
222 | 227 | "derivative_folder = \"derivative_stiched\"\n", |
223 | 228 | "\n", |
224 | 229 | "def process_files(files):\n", |
|
269 | 274 | "metadata": {}, |
270 | 275 | "outputs": [], |
271 | 276 | "source": [ |
272 | | - "from TPTBox.segmentation import run_totalvibeseg\n", |
273 | 277 | "from TPTBox import BIDS_FILE\n", |
| 278 | + "from TPTBox.segmentation import run_totalvibeseg\n", |
| 279 | + "\n", |
274 | 280 | "# run_totalvibeseg\n", |
275 | 281 | "# You can alos use a string/Path if you want to set the path yourself.\n", |
276 | 282 | "dataset = \"/media/data/robert/datasets/dicom_example/dataset-VR-DICOM2/\"\n", |
277 | 283 | "in_file = BIDS_FILE(f\"{dataset}/derivative_stiched/sub-111168222/T2w/sub-111168222_sequ-301-stiched_acq-ax_part-water_T2w.nii.gz\",dataset)\n", |
278 | 284 | "out_file = in_file.get_changed_path(\"nii.gz\",\"msk\",parent=\"derivative\",info={\"seg\":\"TotalVibeSegmentator\",\"mod\":in_file.bids_format})\n", |
279 | | - "run_totalvibeseg(in_file,out_file)" |
| 285 | + "run_totalvibeseg(in_file,out_file,True)" |
280 | 286 | ] |
281 | 287 | }, |
282 | 288 | { |
|
309 | 315 | "outputs": [], |
310 | 316 | "source": [ |
311 | 317 | "# Pick a fitting model:\n", |
312 | | - "from spineps.models import modelid2folder_semantic,modelid2folder_instance\n", |
| 318 | + "from spineps.models import modelid2folder_instance, modelid2folder_semantic\n", |
| 319 | + "\n", |
313 | 320 | "print('Available Semantic Models',modelid2folder_semantic())\n", |
314 | 321 | "print('Available Instance Models',modelid2folder_instance())\n", |
315 | 322 | "\n", |
|
331 | 338 | "outputs": [], |
332 | 339 | "source": [ |
333 | 340 | "from TPTBox.segmentation.spineps import run_spineps_single\n", |
| 341 | + "\n", |
334 | 342 | "#With 'ignore_compatibility_issues = True' you can force to rund\n", |
335 | 343 | "out_paths = run_spineps_single(\n", |
336 | 344 | " file_path,\n", |
|
0 commit comments