mattiaspaul / deedsBCV

new and more efficient version for 3D discrete deformable registration, reaching the highest accuracy in several benchmarks
MIT License
100 stars 32 forks source link

some question in the second case which is about pancreas #2

Open hejinchan opened 5 years ago

hejinchan commented 5 years ago

Hi,

When I implement the second case,I have a problem:

Why we should flip label image around y axis ? Because I find that the label of pancreas correspond to the abdominal cavity image,but when flip label image around y axis,they are not corresponding.

and: When I not flip the label image,the result is as the following figure(use 3dslicer to observe the result): 2018-10-28 17-25-32 the seg1_res.nii.gz and nonlinear_1_3_deformed_seg.nii.gz overlap.

When I flip the label image,the result is as the following figure: 2018-10-28 17-26-05 we can find that there have a displacement between the seg1_res.nii.gz and nonlinear_1_3_deformed_seg.nii.gz,the displacement make the two images cannot overlap.

Looking forward to your answer!

Thanks!

chr-wei commented 3 years ago

I had a similiar issue with converting the data and moved "-flip y" to the beginning of the c3d call (see pull request #8).

In addition the dcm2niix tool did not work for me somehow and I used this little snippet here to convert dicom files to nifti:

from pathlib import Path
import csv

DATA_ROOT = Path("./nbia_downloaded_data/manifest-1599750808610")

metadata = csv.DictReader(open(DATA_ROOT.joinpath('metadata.csv'), mode='r'))
for entry in metadata:
    # Examine metadata from NBIA data retriever
    subject = entry['Subject ID']
    subject_path = Path(entry['File Location'])
    path = DATA_ROOT.joinpath(subject_path)
    # Retrieve the series id from the dicom directory
    series_dict = !c3d -dicom-series-list {path}
    series_dict = csv.DictReader(series_dict, delimiter='\t')
    series_id = next(series_dict)['SeriesID']

    nii_output_path = INTERMEDIATE_PATH.joinpath(subject + '.nii.gz')
    print(f"Creating '{nii_output_path}' from '{path}'")
    # Read the series from folder selected by id
    !c3d -dicom-series-read {path} {series_id} -o {nii_output_path}