The 2D registration results are dark
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- Mezza giornata
- Idoneità per principianti
- 30/100
Direzione di ricerca
The suspect is img_to_single_component, which converts the input with img.convert('P') (palette mode) before ants.from_numpy, so the array holds palette indices rather than intensities. Also check the randome_seed typo in the ants.registration call. Reproduce with two small 2D grayscale images, comparing mode 'P' against 'L' or 'F', then confirm the warped output is no longer dark. Done means a documented explanation of the input-mode requirement, or a fix that makes the output match the intensities of the inputs.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Hi, I was using ANTsPy to register 2D images, but I got 2 dark image as warped result and inverse warped result, I don't understand what's going on.
To Reproduce
My code to register the images is as follow:
def img_to_single_component(name):
img = Image.open(name)
# img = img.resize((1080, 1080))
img = img.convert('P')
img1 = ants.from_numpy(np.array(img))
return img1
def antsRegistration(fi_path, mv_path, method, random_seed):
fi = img_to_single_component(fi_path)
mi = img_to_single_component(mv_path)
mytx = ants.registration(fixed=fi, moving=mi, type_of_transform=method, randome_seed=random_seed)
my_warped_image = ants.apply_transforms(fixed=fi, moving=mi, transformlist=mytx['fwdtransforms'],interpolator='nearestNeighbor')
my_inversed_warped_image = ants.apply_transforms(fixed=mi, moving=fi, transformlist=mytx['invtransforms'],interpolator='nearestNeighbor')
imageio.imwrite(f'{method}_Warped.png', my_warped_image.numpy())
imageio.imwrite(f'{method}_InverseWarped.png', my_inversed_warped_image.numpy())
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots

This is the warped image I get, the method is "Affine" and the interpolation is set to be "nearestNeighbor"
Desktop (please complete the following information):
- OS: Windows 10 Pro 64
- Lingua principale
- Python
- Stelle
- 891
- Fork
- 180
- Merge medio
- 1g 56m
- PR unite (30g)
- 20
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ANTsX/ANTsPy
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
ANTsX/ANTsPy#947 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Usage of `astype` to cast larger types to smallerForse di nuovo libera @cookpa l’ha presa 39 giorni fa e non c’è nessuna pull request aperta. Apertaenhancement
ANTsX/ANTsPy#921 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Build Wheel ErrorAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
ANTsX/ANTsPy#911 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Changes for ITK 6.0.0Aperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
ANTsX/ANTsPy#885 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
distribution
Difficoltà 4/5 3-5 giorni Idoneità per principianti 24/100
ANTsX/ANTsPy#870 · 8 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ANTsX/ANTsPy
Issue simili
-
area/test type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Clodmony/starship-coop#70 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
punitarani/fli#270 ·
-
🐛 Bug 🔔 Pending processing
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
jumpserver/jumpserver#17980 ·
I maintainer di solito rispondono entro 1 giorno
-
community enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
namespace
Difficoltà 2/5 1-3 ore Idoneità per principianti 60/100
EclipseFdn/open-vsx.org#15341 ·
I maintainer di solito rispondono entro 1 giorno