microsoft / Recursive-Cascaded-Networks

[ICCV 2019] Recursive Cascaded Networks for Unsupervised Medical Image Registration
https://arxiv.org/abs/1907.12353
MIT License
361 stars 87 forks source link

Convert to h5 format #44

Closed Shubham0209 closed 3 years ago

Shubham0209 commented 3 years ago

Hello, @zsyzzsoft

Thank you so much for this wonderful work on image registration. I am new to this field I was able to successfully run your model/code on your dataset. Actually, I have my own dataset with a folder containing image pairs i.e moving and fixed in .nii format eg: fix_img.nii.gz and mov_img.nii.gz.

Can you please guide me on how to convert them into h5 format so that I can use my dataset to train on your model?

Thanks in advance!!

zsyzzsoft commented 3 years ago

The first step is to preprocess those raw images into image crops. For example, we provide a preprocessing pipeline for liver CT scans in demo.py. The second step is to save those preprocessed image crops into an h5 file. You may look into and follow the format of our provided datasets using e.g. h5py.

Shubham0209 commented 3 years ago

The problem is after pre-processing while training the dataset the code any two random images for registration, but I don't want it that way, I want the code to take pair of moving and fixed images. Can you please suggest the edits do I have to make into the code and where?

zsyzzsoft commented 3 years ago

You can pass paired=True to the Dataset object. It will group every two adjacent items in the json file as a pair.