Intrapolytypic and interpolytypic transformation in cadmium iodide crystals